| Author |
Message |
Pie32 Not Banned

Joined: 17 Mar 2005 Posts: 1411 Location: Lost in 84
|
Posted: Tue Nov 27, 2007 8:58 pm Post subject: CSS Fixed Image |
|
|
How can I make an image fixed with CSS? I want it to be an image, and not the background. It should stay in place, even when the screen is scrolled.
I have tried, but it didn't work:
| Code: | <style type="text/css">
#fixedimg
{
position:fixed;
top:50px;
left:50px;
}
</style>
<div id="fixedimg"><img src=myimage.jpg></div> |
_________________ [img]http://luneknight.com.ru/counter.jpg[/img]
Random Battle: [img]http://luneknight.com.ru/l.jpg[/img] vs. [img]http://luneknight.com.ru/r.jpg[/img] |
|
| Back to top |
|
| |
packagedeliverer Pro Freelancer::llp elder

Joined: 20 Feb 2004 Posts: 2692 Location: belgium
|
|
| Back to top |
|
| |
marinaroz Grey Scaled

Joined: 04 Mar 2004 Posts: 2765 Location: Israel
|
Posted: Wed Nov 28, 2007 11:26 pm Post subject: |
|
|
position:fixed; is a badly supported piece of CSS. You might want to avoid it completely or even replace the whole thing with a javascript alternative. That's what I'd do, since I hate using hacks in my CSS. _________________ Tarakana NET |
|
| Back to top |
|
| |
Pie32 Not Banned

Joined: 17 Mar 2005 Posts: 1411 Location: Lost in 84
|
Posted: Thu Nov 29, 2007 11:14 am Post subject: Re: CSS Fixed Image |
|
|
The first one didn't load, but the second one works perfectly. Thanks.
| Quote: | | position:fixed; is a badly supported piece of CSS. You might want to avoid it completely or even replace the whole thing with a javascript alternative. That's what I'd do, since I hate using hacks in my CSS. |
That's alright, I live my life by hacking my way through it. _________________ [img]http://luneknight.com.ru/counter.jpg[/img]
Random Battle: [img]http://luneknight.com.ru/l.jpg[/img] vs. [img]http://luneknight.com.ru/r.jpg[/img] |
|
| Back to top |
|
| |
|
|
|