Web Analytics Made Easy -
StatCounter NS4 backgound color CSS - CodingForum

Announcement

Collapse
No announcement yet.

NS4 backgound color CSS

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    #behind {
    position:absolute;
    background:white;
    layer-background-color:white;
    top:100px;
    left:0px;
    width:200px;
    height:100px;
    z-index : auto;
    }
    <div id="behind"></div>
    Co-Operative Web Development

    Comment


    • #3
      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

      Comment


      • #4
        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.
        Co-Operative Web Development

        Comment


        • #5
          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

          Comment


          • #6
            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.
            Co-Operative Web Development

            Comment

            Working...
            X