Posts

Showing posts with the label Margins in CSS

Margins in CSS

Image
           CSS  Margins The CSS  margin  properties are   used to reserve the space around elements, outsides of its   specified   borders. In CSS, we   have full control over the margins. There are properties for setting the margin for each side of an element (top, right, bottom, and left). To understand more about margins let us understand the CSS Box model first The CSS Box Model CSS arranges the  objects (elements) in  CSS Box Model for design and layout. The CSS box model is actually  a box that wraps around HTML elements, and it consists of: margins, borders, padding, and the  content. The box model allows us to place a border around elements and allocate space elements in relation to other elements. The image below explains the box model:   Let us understand the different parts: Margin - Clears an area around the borde...