✏️ Practice: HTML Divs and Spans, and CSS Sizing Units
Goal: Practice using the the tags we learned in the previous lesson:
<div>tags — places to add classes to large parts of our page and separate out content<span>tags — places to add classes to content within block elements
And practice using the CSS sizing units we learned in the previous lesson:
px%vhandvw
Warm Up
- What is the difference between a
divand aspan? - When would you use a
spanbut not adiv? - When would you use a
divbut not aspan? - Between
pxand%, which sizing unit will cause an element to change size in relation to its parent element?
Code
Meet the goal by completing one of these projects. Make sure to make commits regularly and push to the project's remote repository on GitHub.
Boring Lecture
- Rewrite the
boring-lecturepage and remove theintroclass from the elements themselves, and create a<div>with theintroclass to hold the elements. - Use two sizing units of your choice to size two or more HTML elements.
Blogging Site
- Create a new blogging website about whatever you want and use
<div>s to group together and style each blog post. - On the blogging website, create an "about me" section that's styled differently from the rest of the page.
- Use two sizing units of your choice to size two or more HTML elements.
Resume Site
- Start a new webpage to house your resume. Use
<div>s and<span>s to style sections for your education, work experience, skills, etc. - Use two sizing units of your choice to size two or more HTML elements.