Adding Sub-Headers to our Webpage
Adding sub-headers to our webpage - Next we will add sub headers to our webpage. The header you learned in the last lesson was the <h1> header.
Typically the <h1> header will be your main header for each specific web page. You can create headers with h1 through h6, as the header number increases, the font gradually decreases in size.
Many webpages you see probably use <h1>, <h2>, and maybe <h3> it really all depends on the content you are presenting. Think main topics vs sub topics and furthur sub topics.
Step 1: Adding Sub Headers
Once again, locate the
<body></body> tags.
This time, we'll have our
<h1>Main Topic</h1>
Followed by a paragraph...
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. ...</p>
Followed by a sub topic header...
<h2>Sub Topic 1 </h2>
Followed by another paragraph...
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. ...</p>
Followed by another sub topic header...
<h2>Sub Topic 2 </h2>
And then followed by another paragraph...
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. ...</p>
Followed by another sub topic header - this time h3 ..
<h3>Sub Topic 2 </h3>
And then followed by another paragraph...
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. ...</p>
It should be clear how the headers decrease in size as the header value increases...
Sub Header - HTML Example Code
Copy and paste this into your index.html file - go ahead and overwrite the whole file using this code; then access index.html in your browser as in the earlier steps:
Type into the URL address bar:
C:\my_web\index.html
View this example: Sub headers
NEXT: :: Adding Links