With HTML 4.01 DOCTYPE

#testdiv { color:#666; font-size:smaller; border:5px solid #c00; padding:10px; margin:20px; width:400px; /* content only (total = 400+(2x5)+(2x10)+(2x20) = 470px) */ height:100px; }
<-- 400px wide -->
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi in nulla vitae ligula lacinia vulputate. Maecenas turpis tellus, euismod vel, porta eu, posuere sed, justo. Maecenas molestie elit et mauris. Fusce volutpat sem nec nisi. Pellentesque habitant morbi tristique senectus.

The offset properties as reported by your browser

The browsers are fairly consistent in terms of reporting the width and height, where the dimensions returned include the content width, padding and borders (excluding the margins). However, IE5...

Change the dimensions...

[Home]