By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,394 Members | 1,912 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,394 IT Pros & Developers. It's quick & easy.

Box model

P: n/a
So, there are two box models around: the W3C's standard one and the one
used, for example, by IE4. And it becomes an issue when you want to specify
the width or height of an element which has padding and margins != 0. Now I
know that I can hide parts of my CSS from certain browsers, for example:

a { width: 100px; } /* value for IE */
body>a { width: 90px;} /* value for standard box model */

where IE cannot read "body>a" and thus keeps the value of 100px, while other
browsers overwrite it with the value of 90px. And I know I can use (misuse?)
doctypes to force certain browsers into standards or quirks mode... But I
cannot rely upon "quirks browsers" to ignore my "body>a", so there might
actually be a browser which is not capable of rendering in standards mode
but *will* read the second line in the above example. Thus, this is not a
fool proof way of serving each browser the appropriate value for width. Or
is it? I know of other ways to hide CSS from browsers, but I wonder if there
is *the* perfect solution for dealing with this particular problem. Is there
a way I can make sure that every standards compliant browser of the past,
present and future will get the proper value while at the same time all
quirky browsers will get their "quirky" value?


Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Thomas Mlynarczyk wrote:
I know of other ways to hide CSS from browsers, but I wonder if there
is *the* perfect solution for dealing with this particular problem. Is there
a way I can make sure that every standards compliant browser of the past,
nope
present
yes, if we count IE6 to be a standards compliant browser from the past
and future
nope
will get the proper value while at the same time all
quirky browsers will get their "quirky" value?

--
Anne van Kesteren
<http://www.annevankesteren.nl/>
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.