-
Book Overview & Buying
-
Table Of Contents
Web Developer's Reference Guide
By :
Every element in the web is a square, and as such, it has intrinsic characteristics: width, height, padding, border, and margin. All these characteristics, put together, make the box model.
The almighty box model is one of the most talked about subjects in the CSS industry due to IE6 and IE7 being the most popular browsers back in the day. However, they had major issues interpreting this simple CSS concept. This meant the web designers and developers had to come up with all sorts of tricks to get around such a problem. Those days are now gone, for the most part at least.
Let's move on to the box model properties.
The width CSS property specifies the width of an element's content area, and it looks like this:
width: 10px;
Alternatively, it could also look like this:
width: 10px 50px;
The content area is inside the padding, border, and margin of the element.
Let's talk about the most used values and keywords: the length value, percentage value, auto, max-content...
Change the font size
Change margin width
Change background colour