...

View Full Version : Background Fixation (in both IE and Firefox)



reapercharlie
01-28-2007, 12:06 AM
I have two iframes on my site. I want the backgrounds to be fixed, because it would look better while scrolling (especially with the design of the page).

The code I have now works with IE, but does not with Firefox. Can anyone tell me a more efficient way to do this?

The site is here: [link removed]





(Note: If you don't have IE-Tab, it's a very good developer tool, because it allows you to switch back and forth from the IE and Firefox rendering engines, without ever leaving Firefox. Very helpful for code error-testing :) Link is here: https://addons.mozilla.org/firefox/1419/ )

haveacigar
01-28-2007, 01:43 AM
You wont be able to using iframes, and they arnt really needed. If you use css you can have the same effect without using tables, and you will have a faster page loading time.

EDIT::

Or if you want to keep the iframe, just replace the iframe html with this



<html><head><title></title><link rel="stylesheet" href="style.css" type="text/css"></head>
<style type="text/css">
body {background:url('images/main_bg.gif'); background-position:fixed; color:orange;}
</style>
<body>

the turkey that saved thanksgiving - <br>
by daniel turner and joe weaver <br>
<br><br>
chapter 1<br><br>

text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here
text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here
text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here
text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here
text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here
text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here
text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here
text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here
text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here
text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here


</body>
</html>

Arbitrator
01-28-2007, 02:35 AM
The code I have now works with IE, but does not with Firefox. Can anyone tell me a more efficient way to do this?You apparently donít know how background-attachment: fixed works. Internet Explorer is handling it incorrectly. You can read more here (http://www.quirksmode.org/css/background.html).

To get the effect you want in browsers that follow the CSS specification by using background-attachment: scroll; thatís the default, so you donít even need to specify it. Hereís a demonstration (http://jsg.byethost4.com/demos/CF%20106132.html) that uses a div element; Iím not sure if itíll work for inline frames, however.

By the way, your documents also contain numerous coding errors. You can check the HTML errors by using the W3C Markup Validator (http://validator.w3.org/) and the CSS errors by checking the W3C CSS Validator (http://jigsaw.w3.org/css-validator/). Example errors include putting the HTML tags <style> into your CSS files and missing the document type declarations (http://www.w3.org/QA/2002/04/valid-dtd-list.html) at the top of your HTML files.

FullMetal_Ed
01-28-2007, 06:51 PM
try this on each page:
<body bgstyle="fixed">
now the background image will not scroll while everything on the page such as text and images will
hope that helps

reapercharlie
01-29-2007, 02:00 AM
I have tried all of the examples you guys have posted, and they work in their own respective ways, but I can't get it to work right for me on MY site. I need to use iframes (at least i THINK so... do i?) to get it so that when you click a link in the left iframe, it goes to the right iframe... that's the way I want the site to function. I just don't want the background to scroll when the text does.

If I use the command
scrolling="no" on the iframe, and then use the div, would that fix my problem?

haveacigar
01-29-2007, 02:46 AM
I have re-edited the code, try replacing it again... it should work...

reapercharlie
01-29-2007, 03:37 AM
Thanks! You guys are the best! I now have everything up and working the way I wanted it to be. I appreciate your guys' help.





P.S. And thanks, Arbitrator, for the heads up about the W3C Markup and CSS Validators!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum