...

View Full Version : static image



sYmaz
02-16-2011, 07:07 PM
hello

here is my website

http://pslab.tk/homewindow.html

look at two advertisements on right and left sides,
so what i want to do is when you scorll down page these advertisemens stay in same sreen position.. i tryed use position:fixed; and static commands, on FF looks fine, but IE and OPERA got bad page floating..

so any ideas how to get same on IE? :(

Excavator
02-16-2011, 08:05 PM
Hello sYmaz,
Position: static; can be a pain to get working in some browsers. IE6 in particular can mess it up.
I only have FF4 and IE8 to test with right now, this works in those two though -
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
html, body {
margin: 0;
padding: 0;
background: #f44d00;
}
#adLeft, #adRight {
height: 600px;
width: 120px;
position: fixed;
top: 0;
background: #f63;
}
#adLeft {
margin: 0 0 0 -520px;
left: 50%;
}
#adRight {
margin: 0 -520px 0 0;
right: 50%;
}
#container {
width: 800px;
margin: 0 auto;
background: url(http://pslab.tk/images/contentwindow-14.jpg);
}
</style>
</head>
<body>
<div id="adLeft"></div>
<div id="adRight"></div>
<div id="container">
<p>
Lorem <br /> ipsum <br /> dolor <br /> sit <br /> amet, <br /> consetetur <br /> sadipscing <br /> elitr <br />, sed <br />
diam <br /> nonumy <br /> eirmod <br /> tempor <br /> invidunt <br /> ut <br /> labore <br /> et <br /> dolore <br /> magna
Lorem <br /> ipsum <br /> dolor <br /> sit <br /> amet, <br /> consetetur <br /> sadipscing <br /> elitr <br />, sed <br />
diam <br /> nonumy <br /> eirmod <br /> tempor <br /> invidunt <br /> ut <br /> labore <br /> et <br /> dolore <br /> magna
Lorem <br /> ipsum <br /> dolor <br /> sit <br /> amet, <br /> consetetur <br /> sadipscing <br /> elitr <br />, sed <br />
diam <br /> nonumy <br /> eirmod <br /> tempor <br /> invidunt <br /> ut <br /> labore <br /> et <br /> dolore <br /> magna
Lorem <br /> ipsum <br /> dolor <br /> sit <br /> amet, <br /> consetetur <br /> sadipscing <br /> elitr <br />, sed <br />
diam <br /> nonumy <br /> eirmod <br /> tempor <br /> invidunt <br /> ut <br /> labore <br /> et <br /> dolore <br />
LAST WORD
</p>
<!--end container--></div>
</body>
</html>

sYmaz
02-16-2011, 08:37 PM
aah, thx :) this what i need. but maybe there is other way to do that? i putted my advrtisement, java script code in DIV tag, so maybe there simple code for this type of positioning my image?



sorry for bad english ;)

Excavator
02-16-2011, 08:43 PM
I don't know that I could combine your layout with my example and get it to work. All your tables and absolute positioning are hard to work with.

You could use that code I gave you as a template for rewriting your site without tables. That's how I would do it.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum