widths in Netscape/Mozilla

Discussion in 'HTML' started by James Yu, Feb 11, 2004.

  1. James Yu

    James Yu Guest

    When I specify a width in css for a box, Netscape renders the box with a
    width of "width + padding". I want Netscape to just consider the absolute
    width of the box, and not take padding into account at all. Are there any
    work arounds? This is inconsistent with IE. Or am I missing something?

    Thanks,
    James
     
    James Yu, Feb 11, 2004
    #1
    1. Advertising

  2. James Yu

    Mark Parnell Guest

    On Tue, 10 Feb 2004 20:48:01 -0500, "James Yu" <>
    declared in alt.html:

    > When I specify a width in css for a box, Netscape renders the box with a
    > width of "width + padding".


    No it doesn't. URL?

    --
    Mark Parnell
    http://www.clarkecomputers.com.au
     
    Mark Parnell, Feb 11, 2004
    #2
    1. Advertising

  3. James Yu wrote:

    > When I specify a width in css for a box, Netscape renders the box with a
    > width of "width + padding". I want Netscape to just consider the absolute
    > width of the box, and not take padding into account at all. Are there any
    > work arounds? This is inconsistent with IE. Or am I missing something?


    Netscape does it the right way. Most other browsers do too. The width of
    a rendered element should be:

    'border-left' + 'padding-left' + 'width' + 'padding-right' + 'border-right'

    And the amount of space that it takes up should be:

    'margin-left' + 'Rendered Width (as above)' + 'margin-right'

    Netscape, Opera, Konqueror, Safari all get this right. IE5 gets this
    wrong. IE6 can be told to get it right though. How? By setting a DOCTYPE.
    How? As the first line of your HTML, include this:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?page=132
     
    Toby A Inkster, Feb 11, 2004
    #3
  4. James Yu

    Mark Parnell Guest

    On Wed, 11 Feb 2004 12:59:26 +1100, Mark Parnell
    <> declared in alt.html:
    >
    > No it doesn't. URL?


    Duh. Blonde moment. See Toby's post.

    --
    Mark Parnell
    http://www.clarkecomputers.com.au
     
    Mark Parnell, Feb 13, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. nospam
    Replies:
    4
    Views:
    1,725
    nandulwc
    Sep 9, 2009
  2. =?Utf-8?B?QWJ1IEhhaWRlcg==?=

    Server Controls don't render style to Mozilla and Netscape

    =?Utf-8?B?QWJ1IEhhaWRlcg==?=, Feb 22, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    328
    Teemu Keiski
    Feb 23, 2004
  3. Tom
    Replies:
    0
    Views:
    505
  4. Mickey Segal
    Replies:
    1
    Views:
    675
    Mickey Segal
    May 21, 2004
  5. yaktipper
    Replies:
    10
    Views:
    289
    Richard Cornford
    Jul 10, 2003
Loading...

Share This Page