Lifelesspeople.com

 Forum FAQsForum FAQs  Knowledge BaseKnowledge Base  RulesRules   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   HostingHosting   RegisterRegister 
 DonateDonate   WikiWiki   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CSS Fixed Image

 
Lifelesspeople.com Forum Index -> Web Architects' Abode
Post new topic   Reply to topic View previous topic :: View next topic  
Author Message
Pie32
Not Banned


Joined: 17 Mar 2005
Posts: 1411
Location: Lost in 84

PostPosted: Tue Nov 27, 2007 8:58 pm    Post subject: CSS Fixed Image Reply with quote

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

PostPosted: Wed Nov 28, 2007 7:08 am    Post subject: Re: CSS Fixed Image Reply with quote

Info:
http://www.howtocreate.co.uk/fixedPosition.html

Better working example:
http://annevankesteren.nl/test.....fixed.html
_________________
[img:0a108d93e8]http://img338.imageshack.us/img338/9430/packagedeliverer54hy.gif[/img:0a108d93e8]
Back to top
 
marinaroz
Grey Scaled


Joined: 04 Mar 2004
Posts: 2765
Location: Israel

PostPosted: Wed Nov 28, 2007 11:26 pm    Post subject: Reply with 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.
_________________
Tarakana NET
Back to top
 
Pie32
Not Banned


Joined: 17 Mar 2005
Posts: 1411
Location: Lost in 84

PostPosted: Thu Nov 29, 2007 11:14 am    Post subject: Re: CSS Fixed Image Reply with quote

packagedeliverer wrote:
Info:
http://www.howtocreate.co.uk/fixedPosition.html

Better working example:
http://annevankesteren.nl/test.....fixed.html

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
 
Display posts from previous:   
Post new topic   Reply to topic    Lifelesspeople.com Forum Index -> Web Architects' Abode All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Home | Hosting | News | Forum | Links | System Status | About | Archive | Donate ]
Powered by phpBB © 2001, 2002 phpBB Group
All trademarks and copyrights on this page are owned by their respective owners. Posts and comments are owned by the poster. Everything else © 2001 - 2007 Lifelesspeople.com