Headings Exercise
Learn how to use HTML heading tags (h1 through h6) and practice styling them with colors and alignment.
Loading...
Loading exercise code...
Exercise: Master HTML Headings
Objectives
In this exercise, you will:
- Learn the difference between heading levels
<h1>through<h6> - Understand heading hierarchy and SEO importance
- Practice styling headings with CSS
- Learn proper text alignment and decoration techniques
What You’ll Learn
Heading Tags:
<h1>- Page title (largest, most important)<h2>- Section heading<h3>- Subsection- … and so on through
<h6>(smallest)
Styling Tips:
- Use
<style>tags in the<head>section for CSS - Apply colors using
colorproperty - Align text with
text-alignproperty - Make text bold with
<strong>orfont-weight
Challenges in This Exercise
- Fix the red heading - The
fontColorattribute is deprecated. Use CSScolorproperty instead. - Proper text alignment - The
<center>tag is deprecated. Usetext-align: centerin CSS instead. - Responsive sizing - Make the paragraph responsive using modern CSS width properties.
Tips for Success
- Always use CSS for styling, not HTML attributes
- Use semantic HTML tags (
<strong>instead of<b>) - Remember heading hierarchy is important for accessibility
- Test your changes in the Preview tab to see results immediately
Next Steps
After completing this exercise:
- Try changing the heading colors
- Experiment with different font sizes
- Practice using CSS classes for styling multiple headings
- Move on to the Links exercise!