CSS Lesson 3: Adding a Header

Hi Everyone!

In our last CSS lesson we learnt how to add background colors and containers. Today we will be learning how to make a header. To make a header (similar to containers) we need to link our CSS code back to our HTML code. For this we will need two files, an ‘index.html’ file and a ‘stylesheet.css’.

Firstly let’s write our CSS code. Using CSS we can customize our header like so.

h1 {
font-family: Courier;
font-size: 20px;
color: blue;
}

Next we’ll write our HTML code. Through this code we’ll link our two files together and we’ll also write what we want our header to display.

<link href”stylesheet.css” rel=“stylesheet” type=“text/css”>
<h1>Yay! You made a heading.</h1>

That’s it! If you have any questions about this code feel free to leave a comment below. Happy coding! 🙂

Advertisements