Layout with HTML & CSS
Use the Display Property Exercise Page with these instructions.
Complete this during class, recording your observations. For homework, mark up in HTML and post on your Week 3 page.
- Look over the HTML and CSS of the Display Property page. Describe what you see.
- Use the web inspector to change the display property of the first paragraph to
inline
. Describe what you see. - Change the second paragraph to
inline
. Describe what you see. - Now change the third. Describe what you see.
- Describe why the paragraphs changed.
Reload the page to get rid of the changes.
- Using the web inspector, add a rule using
p
as the selector. Set it todisplay: inline-block
. Any change?
Reload the page to get rid of the changes.
- Look at the second section, Go bear, go!. Why is this section displaying in a line?
-
Look at the following rule. How do you expect it will change the document
p, i { width: 300px; height: 300px; }
Add the rule using the web inspector. What did you actually see? Explain any differences from what you expected and why.
- Use the web inspector to change the display property of the first
i
toblock
. What happened? - Remove the width and height rules. Add a margin of 3em instead. What do you see? Why?
p, i { margin: 3em; }