Cascading Style Sheets (CSS) Tutorial – Border

Border is frame of Line surrounding an element. This Line can be solid , dotted among many other options. Available spacing options in CSS

Each element can defined once for four sides or individually for top, bottom, right and left.


Define border-style
In CSS syntax border-style can be defined by dashed, dotted, double, groove, hidden, inset, none, outset, ridge and solid.

selector { border-style: style_option ;}

Define border-width
This property controls thickness of border. Available options are thick, medium, thin, inherit or absolute value can be given in Units : px (pixels), pt (points), pc (picas), mm (millimetres), cm (centimetres), in (inches), em and %.

selector { border-width: border-width_option;}

Coloring border
Color can be add to border standard colors names or precise hex code of color an be used.

selector { border-color: color name or hex code;}