Setting the Direction of Margins
Margins and padding allow you to add space in specific directions: top, bottom, left, and right.
Top, bottom, left, and right refer to the margin or padding space at the top, bottom, left, and right parts of a page, respectively.
Applying CSS Properties to the box Class
.box {
margin-top: 10px; /* Adds 10px of space to the top */
padding-bottom: 20px; /* Adds 20px of space to the bottom */
margin-left: 10%; /* Adds left margin equal to 10% of the element's width where the box class is applied */
}
Want to learn more?
Join CodeFriends Plus membership or enroll in a course to start your journey.