CSS border: 3 Examples to Style Borders in div, table

What is the border property in CSS?

The border properties of CSS allow placing the border(s) around the HTML elements. This is very useful and gives the control to specify the border specifications.

>>See a div border example

You can place the borders in different elements like div, table, lists on the top, bottom, left or right with different colors and widths.

The borders make it quite easier to differentiate among different elements of your web page with different styling that otherwise you had to do by using HTML table/borders or by using the images etc.

Setting borders separately example

You can specify CSS border styles in one declaration by using the border property, for a simple border. Alternatively, you can specify the border properties separately by using the border properties like border-top, border-top-color, border-top-width etc to control border look.

Watch the Video of this tutorial: