Web design: CSS margin and padding

The tutor shows examples of margin and padding, two important aspects of a webpage element’s style.

An element’s margin is the space around it. It can also be seen as the space between the element and other elements.

This paragraph has a margin 70% of the page. That’s why it runs on so many different lines.
margin-right:70%;

An element’s padding is the space between its content (text or image) and its own outer border.

This paragraph has 20% padding. Note the distance from this text to the outside of this box, in any direction.
padding:20%;


I’ll be showing more CSS concepts in coming posts:)

Source:

w3schools

w3schools

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Tagged with: ,

Leave a Reply