Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Fixed Page Barckgroun IE and FF


  • Please log in to reply
5 replies to this topic

#1 AliceZ

AliceZ

  • Members
  • 32 posts
  • OFFLINE
  •  
  • Gender:Female
  • Location:NE USA
  • Local time:06:41 AM

Posted 02 November 2011 - 08:33 AM

Fixed background
I've tried several "fixed" HTML background for my site.

Some allow the background to stay "fixed" when viewed in IE, but in FF the background moves downward as the page moves downward.

Is there one definitive HTML I could use that would keep the background FIXED in both IE and FF?
Something not too complicated that I could use? (I am not that knowledgeable about computers and HTML and CSS, etc.)

One I've tried is:
<body background="http://www.XXXX.gif" bgproperties="fixed">
Works in IE, but not in FF.


Another I tried is:

<STYLE TYPE="text/css">
body {background-image: url("http://www.XXX.jpg"); background-attachment: fixed;}
</style>

But that one, when I am IE, and click to go back to previous page, doesn't show the background image at all on the page (I went back to, even though fixed background was there when I first looked at that page. (Does that make sense?)

P.S. Does it make a difference where we place the "background" HTML script in the webpage? Before HEAD, after HEAD, top of BODY, etc?

Thank you.

BC AdBot (Login to Remove)

 


#2 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:04:41 AM

Posted 02 November 2011 - 10:47 AM

Different browsers do different things, so no, there is not necessarily a definitive way to do what you want, although I am not 100% sure what you want. Are you saying you want the background to remain fixed, whilst the rest of the content is scrollable?

#3 AliceZ

AliceZ
  • Topic Starter

  • Members
  • 32 posts
  • OFFLINE
  •  
  • Gender:Female
  • Location:NE USA
  • Local time:06:41 AM

Posted 02 November 2011 - 12:25 PM

Different browsers do different things, so no, there is not necessarily a definitive way to do what you want, although I am not 100% sure what you want. Are you saying you want the background to remain fixed, whilst the rest of the content is scrollable?


Yes. Background stays fixed, while you move up/down the page. to read text.

As I mentioned, this one:
<body background="http://www.XXXX.gif" bgproperties="fixed">

keeps background fixed when viewed in IE8, but the background scrolls up/down when you move text up/down while in FF.

#4 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:04:41 AM

Posted 02 November 2011 - 02:29 PM

The bgproperties attribute is specific to IE, so shouldn't be used anyway. The correct way is to use CSS; The image not showing up when going back is caused by something else, possibly an error in your HTML. Have you validated it?

#5 AliceZ

AliceZ
  • Topic Starter

  • Members
  • 32 posts
  • OFFLINE
  •  
  • Gender:Female
  • Location:NE USA
  • Local time:06:41 AM

Posted 02 November 2011 - 05:02 PM

The bgproperties attribute is specific to IE, so shouldn't be used anyway. The correct way is to use CSS; The image not showing up when going back is caused by something else, possibly an error in your HTML. Have you validated it?



How about using the 2nd one I mentioned above?

This one:

<STYLE TYPE="text/css">
body {background-image: url("http://www.XXX.jpg"); background-attachment: fixed;}
</style>

Would that work both in IE8 and FF?

#6 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:04:41 AM

Posted 02 November 2011 - 05:28 PM

Yes. that is css, and that would be the correct method.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users