Tag Archives: CSS Margins and Padding

CSS Margins and Padding

margin and padding are the two most commonly used properties for spacing-out elements. A margin is the space outside of the element, whereas padding is the space inside the element. Change the CSS code for h2 to the following:   h2 {         font-size: 1.5em;         background-color: #ccc;         margin: 1em;         padding: 3em; } […]