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 6 of 6
  1. #1
    New Coder
    Join Date
    Jun 2002
    Location
    North of Boston
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Netscape NS4 backgound color CSS

    this works in NS6 and IE5 but not in
    NS4

    basiclly it is supposed to
    create a spot on the page that is white
    but it does work in NS4.

    according to topstyle this is a NS4 property


    #behind {
    position:absolute;
    background:white;
    top:100px;
    left:0px;
    width:200px;
    height:100px;
    z-index : auto;
    }
    <div id="behind"></div>

    Does anybody know why this isn't displying properly in NS4?

    I have tried using
    background-color:white;
    but no good either


    Thanks
    bedardinc.com
    A+,Network+, MCP W2K
    Sites I have worked on
    patriotsweekly.com
    smileysbookstore.com

  • #2
    New Coder
    Join Date
    Jun 2002
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts
    #behind {
    position:absolute;
    background:white;
    layer-background-color:white;
    top:100px;
    left:0px;
    width:200px;
    height:100px;
    z-index : auto;
    }
    <div id="behind"></div>

  • #3
    New Coder
    Join Date
    Jun 2002
    Location
    North of Boston
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Netscape

    Thanks but it is still not working.

    <STYLE type="text/css"> <!--
    #behind {
    position:absolute;
    background:white;
    layer-background-color: White;
    top:100px;
    left:0px;
    width:200px;
    height:100px;

    }
    -->
    </STYLE>

    <div id="behind"></div>
    bedardinc.com
    A+,Network+, MCP W2K
    Sites I have worked on
    patriotsweekly.com
    smileysbookstore.com

  • #4
    New Coder
    Join Date
    Jun 2002
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Oops, forgot the clip values that NS4 needs. Don't ask me why, lol.

    <STYLE type="text/css"> <!--
    #behind {
    position:absolute;
    background:white;
    layer-background-color: White;
    top:100px;
    left:0px;
    width:200px;
    height:100px;
    clip:rect(0,200,100,0);
    }
    -->
    </STYLE>

    Try that.

  • #5
    New Coder
    Join Date
    Jun 2002
    Location
    North of Boston
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile

    Thanks so much ,La Gal

    can't believe such a minor detail take so much to get to work.

    so these are only necessary in NS4 if you want to specify a background color for the id in a div tag ?

    layer-background-color: White;
    clip:rect(0,200,100,0);
    bedardinc.com
    A+,Network+, MCP W2K
    Sites I have worked on
    patriotsweekly.com
    smileysbookstore.com

  • #6
    New Coder
    Join Date
    Jun 2002
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes. NS4 will only show the background color on the part of a div that has content. IE and NS6 do not have this problem. So you need to use a workaround. Using layer-background-color along with clip:rect values is one way to get around it.

    I believe another solution would be give the div a solid border of 0.1px. Such a narrow border would not show up on either browser but would cause NS4 to fill in the div with the background color even if there is no content in the div. However, I don’t find this second solution preferable because of another bug in NS4 that causes a small space (about 3px) between the border and any content you do have in the div. *sigh*

    Of course you could also fill the div with non breaking spaces, but that would be very tedious.


  •  

    Posting Permissions

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