Day 3 of Java Full Stack Learning

Display flex: It is a value of a CSS attribute that turns an element into a flex container. When display: flex is applied to an HTML element, it enables flexbox layout, which allows to control the alignment, direction and spacing of the elements.

Syntax for display flex:
.container {
display: flex;
}

Flex properties:
display: flex – Enables flexbox layout.
flex-direction Sets the direction of flex items.
justify-content Aligns items horizontally.
align-items Aligns items vertically.
Row
Column
Row-reverse
Column-reverse

CSS Margin: It is the space outside the border of elements. This creates spacing between element and its neighbors(other elements).

Syntax:
margin: 20px;

CSS Margin Properties:
margin

margin-top

margin-right

margin-bottom

margin-left

CSS Padding: Padding in CSS is the space between the content of an element and its border. It controls the internal spacing—how much room is inside the element around its content.

Syntax:
padding: 20px;

CSS Padding Properties:

padding
padding-top
padding-bottom
padding-right
padding-left

Example
<div class="box">Hello World</div>

Similar Posts