Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Jan 2007
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Background Fixation (in both IE and Firefox)

    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/ )
    Last edited by VIPStephan; 02-27-2011 at 11:11 AM. Reason: link removed upon request

  • #2
    New Coder
    Join Date
    Aug 2006
    Posts
    97
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

    Code:
    <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>
    Last edited by VIPStephan; 02-27-2011 at 11:12 AM.

  • #3
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,306
    Thanks
    29
    Thanked 276 Times in 270 Posts
    Quote Originally Posted by reapercharlie View Post
    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.

    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 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 and the CSS errors by checking the W3C CSS Validator. Example errors include putting the HTML tags <style> into your CSS files and missing the document type declarations at the top of your HTML files.
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #4
    New Coder
    Join Date
    Dec 2006
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #5
    New Coder
    Join Date
    Jan 2007
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    Code:
    scrolling="no"
    on the iframe, and then use the div, would that fix my problem?

  • #6
    New Coder
    Join Date
    Aug 2006
    Posts
    97
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have re-edited the code, try replacing it again... it should work...

  • #7
    New Coder
    Join Date
    Jan 2007
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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!
    Last edited by reapercharlie; 01-29-2007 at 05:18 AM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •