SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Apr 2004
    Location
    Cape Town
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    width and height style attributes in Netscape 4.7

    unfortunately a client has a requirement that a site work in netscape 4.7. i have installed netscape communicator 4.74 to test with.

    i was testing the support of DIV tags as the site requires the use of layers. i created a simple div container but it does not seem to recognise the width or height attributes. I have browsed the web for known NN4 bugs but didn't come across any relating to width or height attributes. does anyone know if this is a known bug?

    here is the test code
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en-us">
    <style type="text/css">
    .test {
    	background: #ff0000;
    	width: 500px;
    	height: 100px;
    }
    </style>
    </head>
    <body>
    <div class="test">&nbsp;</div>
    </body>
    </html>
    the div does not display correctly, it's just a couple of pixels wide due to the space.

    any insight would be much appreciated
    Brett Reid
    Web Application Developer

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    39,809
    Mentioned
    158 Post(s)
    Tagged
    4 Thread(s)
    Try putting a white border around it.
    Code:
    .test {
     background: #ff0000;
     width: 500px;
     height: 100px;
    border:1px solid #fff;
    Paul

  3. #3
    SitePoint Member
    Join Date
    Apr 2004
    Location
    Cape Town
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks Paul,

    i tested it and it seems to stretch the div to it's correct width now. it does however pad the div container by 2 pixels?
    the height does not seem to work though, here is a screenshot:
    http://www.brett-reid.com/screengrab.gif

    as you can see, the width is fine but the height...not so fine.

    ahhh the panic
    Brett Reid
    Web Application Developer

  4. #4
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    39,809
    Mentioned
    158 Post(s)
    Tagged
    4 Thread(s)
    Hi,

    I don't know a lot about nn4 because I don't support it anymore but I believe you need the non-standard layer-background-colour and position:relative;

    e.g.
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en-us">
    <style type="text/css">
    .test {
    background: #ff0000;
    width: 500px;
    height: 100px;
    position:relative;
    border:1px none #000000;
    layer-background-color: #FF0000;
    }
    </style>
    </head>
    <body>
    <div class="test">&nbsp;</div>
    </body>
    </html>
    Paul

  5. #5
    SitePoint Member
    Join Date
    Apr 2004
    Location
    Cape Town
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    works perfectly! thanks a million.
    Brett Reid
    Web Application Developer


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
  •