Borders In CSS

Border is a property that defines the style, width and color of the element's border.

Effects of Borders

Hover the mouse over me to see the effect of border

How to USE Borders

border-style: solid; /* border style */
border-width: 2px; /* border width */
border:#f33; /* border color */
border: 2px dashed green; /* width | style | color */

border-top: 2px solid blue; /* border-top */
border-right: 2px solid red; /* border-right */
border-bottom: 2px solid #f33; /* border-bottom */
        

Margins In CSS

a property that defines the space between the element and its parent element.

Effects of Margin

Hover over me to see the effects of margins

How to USE Margin

CSS has properties for specifying the margin for each side of an element:
margin-top, margin-right, margin-bottom, margin-left.

margin-top: 100px; /* margin from the top */
margin-bottom: 100px; /* margin from the bottom */
margin-right: 150px; /* margin from the right */
margin-left: 80px; /* margin from the left */
margin: 25px 50px 75px 100px; /* margin from all sides */