How to fix an image outside the <body> tag?

Reply

Join Date: Jul 2006
Posts: 174
Reputation: tefflox is an unknown quantity at this point 
Solved Threads: 1
tefflox's Avatar
tefflox tefflox is offline Offline
Junior Poster

Re: How to fix an image outside the <body> tag?

 
0
  #11
Jan 8th, 2007
This isn't working --- div#moon { position: absolute; top: 20%; right: 20%; width: 120px; height: 127px; background-image: url('/06/fullmoon.jpg'); background-repeat: no-repeat; background-attachment: fixed; }
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 1,091
Reputation: MattEvans is a jewel in the rough MattEvans is a jewel in the rough MattEvans is a jewel in the rough 
Solved Threads: 63
Moderator
Featured Poster
MattEvans's Avatar
MattEvans MattEvans is offline Offline
Veteran Poster

Re: How to fix an image outside the <body> tag?

 
0
  #12
Jan 8th, 2007
it would be more helpful for me and anyone else who may have some helpful ideas, and thus for yourself; if you say what isn't working.

- did it crash your computer? (hopefully not)
- did it show up fine in the correct place initially, but not remain fixed with relation to scroll?
- or somewhere inbetween?
Plato forgot the nullahedron..
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 174
Reputation: tefflox is an unknown quantity at this point 
Solved Threads: 1
tefflox's Avatar
tefflox tefflox is offline Offline
Junior Poster

Re: How to fix an image outside the <body> tag?

 
0
  #13
Jan 8th, 2007
Sorry, I'm tired. Okay, the image doesn't show up at all for the above code. I'm using Firefox 2.
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 1,091
Reputation: MattEvans is a jewel in the rough MattEvans is a jewel in the rough MattEvans is a jewel in the rough 
Solved Threads: 63
Moderator
Featured Poster
MattEvans's Avatar
MattEvans MattEvans is offline Offline
Veteran Poster

Re: How to fix an image outside the <body> tag?

 
0
  #14
Jan 8th, 2007
but, having a stab at it.

I guess the problem is as I mentioned:

you may find that that div does start scrolling with the page as it has a fixed anchor point. I dunno though: there is definately a calculatable compensation for the background attachment, it's just a question of whether browsers chose to make it.
The background position is fixed relative to the scroll within the div, but that div isn't ever going to scroll

Is there a reason you can't use the body tag for the background?

I would try using a fixed position div behind the main section of your page... It doesn't work in IE usually as I said, but there's workarounds, as I said:

http://www.cssplay.co.uk/layouts/fixed.html
Plato forgot the nullahedron..
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 1,091
Reputation: MattEvans is a jewel in the rough MattEvans is a jewel in the rough MattEvans is a jewel in the rough 
Solved Threads: 63
Moderator
Featured Poster
MattEvans's Avatar
MattEvans MattEvans is offline Offline
Veteran Poster

Re: How to fix an image outside the <body> tag?

 
0
  #15
Jan 8th, 2007
Originally Posted by tefflox View Post
Sorry, I'm tired. Okay, the image doesn't show up at all for the above code. I'm using Firefox 2.
set the div background or borders to blue and see if you can see it.. that CSS should work for an absoulute position
Plato forgot the nullahedron..
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 174
Reputation: tefflox is an unknown quantity at this point 
Solved Threads: 1
tefflox's Avatar
tefflox tefflox is offline Offline
Junior Poster

Re: How to fix an image outside the <body> tag?

 
0
  #16
Jan 8th, 2007
Thanks for helping. I'll get back to this tomorrow.
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 1,091
Reputation: MattEvans is a jewel in the rough MattEvans is a jewel in the rough MattEvans is a jewel in the rough 
Solved Threads: 63
Moderator
Featured Poster
MattEvans's Avatar
MattEvans MattEvans is offline Offline
Veteran Poster

Re: How to fix an image outside the <body> tag?

 
0
  #17
Jan 8th, 2007
My pleasure; post back if you're still having problems.
Plato forgot the nullahedron..
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 20
Reputation: webecho is an unknown quantity at this point 
Solved Threads: 0
webecho webecho is offline Offline
Newbie Poster

Re: How to fix an image outside the <body> tag?

 
0
  #18
Jan 10th, 2007
You can set it as a background image for the HTML
[code] html{background-image:url(whatever);position:fixed;top:0,left:0;}

This would fix the image in the top left corner of the page BEHIND anything else on the page - this might be what you're looking for.

HTH
Last edited by webecho; Jan 10th, 2007 at 7:30 pm. Reason: syntax error
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the HTML and CSS Forum
Thread Tools Search this Thread



Tag cloud for HTML and CSS
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC