Why is box sizing set to border-box for tables in Firefox?
I found that making a table with
<table style="padding-left: 100px; width: 200px">
makes the content only 100px wide. Further investigation revealed that Firefox has
table { -moz-box-sizing: border-box };
rule in its default stylesheet. Is there a reason for that? Are tables supposed to be sized this way according to the CSS standard?
that's strange, i see that you are right, even though mozilla itself says the default value should be content-box. Bug? Seems your only choice have to reset this in your css.
There really isn't any HTML or CSS standard that says how HTML should be styled by default. That's why reset stylesheets are so popular. Largely, each browser just goes with the prevailing behaviour of the other browsers. This would go back to the early Netscape and IE behaviour when tables were first introduced.
精彩评论