Use HTML Div to add border only on top and bottom?

For future reference, the following is a an alternative method that avoids having to define border properties (colour, width) more than once and allows declarations similar to those used for margin and padding (as requested).

border: 5px green;
border-style: solid none;

As with margin or padding, border-style is defined in order of top, right, bottom, left. The above case applies a solid border to top and bottom of an element and no border to the left or right of the element.

Using this method avoids creating redundancies in the declaration.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)