412 Chapter 23 – Cascading Style Sheets
Properties
Web Design in a Nutshell, eMatter Edition
Inherited:
No
Each of these properties is a shorthand property for setting the width, style,
and color of a specific side of a box (as named). The example given would
create a solid blue border .5 em thick on the left side of the H1 element only.
border
Values:
border-width|border-style|border-color
Example:
P.example { border: 2px dotted #666633 }
Applies to:
All elements
Inherited:
No
This is a shorthand property for setting the border width, style, and color for
all four sides of an element box. The values specified inborderwill always
apply to all four sides of the box (unlike other shorthand border properties
described earlier, which can accept values for separate sides).
width
Values:
length|percentage|auto
Example:
IMG.photo { width: 75% }
Applies to:
Block-level elements and replaced elements (such as graphics)
Inherited:
Yes
This property sets the width of the element. It can be applied to text elements
or as a way to resize images.
height
Values:
length|percentage|auto
Example:
IMG.photo { height: 75% }
Applies to:
Block-level elements