Results 1 to 6 of 6

Thread: div bg 100% doesnt work when I add data..

  1. #1
    Join Date
    Aug 2006
    Posts
    130
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default div bg 100% doesnt work when I add data..

    Hello, I use a div tag to place a background and I use height=100% to get it all the way down to the bottom of the page but if I add data such as tables with javascript the height wont update so the background doesnt continue all the way down.. It happens in both FF and opera but not in IE, is there a way to solve this?

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Most likely there are other factors. However, height=100% is technically invalid for a div in HTML, use style, or maybe you did, but that's not clear, and style="height:100%;" (in javascript: style.height='100%') is meaningless unless the element with it has a container element with a set height. IE is known for sometimes overlooking this fact and using either the viewport's (IE's window.clientHeight, other's window.innerHeight) or the page's (IE's and other's document.body or document.documentElement .scrollHeight or .offsetHeight) height. In any case, a link to the problem page would probably be required to get any real help on this.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Aug 2006
    Posts
    130
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    The thing is, I need the background to go all the way down and if I have the bg in the body tag like this:
    Code:
    body {
    background-image:... ;
    }
    The logo that should be at the same position as the background move a little bit to the left on IE...

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I'd still like to see the page live to comment on this with anything nearing certainty. However, generally IE can be made to display as desired in a case like that by using an IE specific stylesheet.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Jul 2006
    Location
    Antwerp, Belgium (Europe)
    Posts
    927
    Thanks
    121
    Thanked 2 Times in 2 Posts

    Default

    If you place
    Code:
    style="height:120px;"
    where 120px is the height of your background image, then it should work fine ?

  6. #6
    Join Date
    Aug 2006
    Posts
    130
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I added a style for IE only to solve it, it was the width that didnt match.

Bookmarks

Posting Permissions

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