Help:Wiki University Wikitext--Margins

Attributes learned so far
So far we have learned the follow attributes:
 * font-family:arial
 * font-size:14pt
 * background-color:lightgray
 * padding:10px
 * padding-top:10px
 * padding-bottom:10px
 * padding-right:10px
 * padding-left:10px

Margins
The next attribute to learn is margins. It is rather like padding only the spacing takes place outside the boundaries not inside the boundaries of the paragraph or div tag.

Lets apply the attribute to our two Lorem ipsum paragraphs in the previous chapter and space them 10 pixels apart using div tags: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sit amet iaculis metus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Fusce elementum efficitur faucibus. Curabitur eleifend quis ligula ac ullamcorper. Curabitur eget suscipit turpis. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sit amet iaculis metus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Fusce elementum efficitur faucibus. Curabitur eleifend quis ligula ac ullamcorper. Curabitur eget suscipit turpis.

 Exercises 1. What is the coding to install our lorem ipsum paragraph in your sandbox with a background color of light green with white text and padding on the top and bottom of 20 pixels.

2. Then load our lorem ipsum paragraph twice with no background color and no text color but with a padding-bottom of the first paragraph of 100px. What happens to the space between the paragraphs? Check your answers >

 Quick Quiz
 * To have the text 20px from the left edge of the background what attribute do you use?
 * A. padding:20px
 * B. padding-right:20px
 * C. padding-left:20px


 * To have the background 50px from all side of the text, what attribute do you use?
 * A. padding-right:50px
 * B. padding-top:50px
 * C. None of the above

Check your answers >