This forum is now read-only. Please use our new forums at discuss.codecademy.com.

CSS: An Overview Forum

View Course » View Exercise

250 points
Picture
Submitted by
Abhilash Anandan
almost 4 years ago

Using height with border can sometimes make elements larger than expected

My styleheet is:

td
{
    height:50px;
    border:1px dashed blue;
}
table
{
    border: 1px solid black;
}

On line 4 I get a small Caution that says "Using height with border can sometimes make elements larger than expected" but the code compiles perfectly. I can proceed to the next lesson.

What does that mean?


1 vote

permalink

It means that different browsers interpret the box model differently. Some include the border in the height, some don't. As a consequence, while one browser renders your object at 50px, another might render it 52px.

The caution is only there so you are made aware of these small inconsistencies between user agents. It is not a syntax error.

7821 points
5958b8ebe12813a2a3000034_980106998
Submitted by
Roy
almost 4 years ago


0 votes

permalink

Okay. Thank you very much Roy.

250 points
Picture
Submitted by
Abhilash Anandan
almost 4 years ago