Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > widths in Netscape/Mozilla

Reply
Thread Tools

widths in Netscape/Mozilla

 
 
James Yu
Guest
Posts: n/a
 
      02-11-2004
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


 
Reply With Quote
 
 
 
 
Mark Parnell
Guest
Posts: n/a
 
      02-11-2004
On Tue, 10 Feb 2004 20:48:01 -0500, "James Yu" <(E-Mail Removed)>
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
 
Reply With Quote
 
 
 
 
Toby A Inkster
Guest
Posts: n/a
 
      02-11-2004
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

 
Reply With Quote
 
Mark Parnell
Guest
Posts: n/a
 
      02-13-2004
On Wed, 11 Feb 2004 12:59:26 +1100, Mark Parnell
<(E-Mail Removed)> declared in alt.html:
>
> No it doesn't. URL?


Duh. Blonde moment. See Toby's post.

--
Mark Parnell
http://www.clarkecomputers.com.au
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VS.net, design view, and 100% table widths darrel ASP .Net 1 01-26-2005 06:28 PM
datagrid column widths - remember after postback wh1974 ASP .Net 1 01-11-2005 04:13 PM
Data Grid Column Widths sck10 ASP .Net 3 11-15-2004 12:39 PM
Unable to set server side table's cell widths as percentages Dot net work ASP .Net 2 05-20-2004 12:56 PM
More Elegant Column Widths in ASP:Table Objects? =?Utf-8?B?QWxleCBNYWdoZW4=?= ASP .Net 1 05-14-2004 07:38 PM



Advertisments