Exercise
Time to put some of this learning to work. Create a new web page and a new css file. Save both and connect them.
Text Sizing: rem and px
- Set the default font size for the entire document to 10px, and also set a generic font (your choice) for the whole document.
- Use rem sizing to appropriately set the font size of the following elements: <p><h1><h2><h3>. Ie. <h1> should be largest, <h2> second largest, etc.
Text-torture: transform, shadow, align, etc.
- Find or create about five lines of dummy text.
- Title your document with an <h1> tag.
- Paste the dummy text within two sets of <p> tags.
- Create headings and sub-headings for each block of text with the <h2> and <h3> tags.
- Use text-transform to set your <h1> content to all caps.
- Add a text-shadow to your <h1> contents.
- Use text-align to center all three headers- <h1>,<h2>, <h3>- at once, using just one rule in your CSS document.
- Set the line height of all of the content within <p> tags to 1.5. If you like the way that looks, stay with it. Otherwise, feel free to ‘space out’ however you want to.
- Add some white space to your content. For example, click at the beginning of a few sentences (within the html code) and press return. Then add a few spaces to separate those sentences from the margin.
- Now experiment with p{white-space:pre-line; } and p{white-space:pre-wrap;} to see what happens!