My First Web Page - Step 4
Bold and Italics for Emphasis
On this page, we'll learn to markup the bold and the italics
We use 2 elements of emphasis: the <strong> element for strong emphasis and the <em> for the slightly less strong element.
Code this under heading 4
<h4> This is Header 4 <h4> <p>This is a normal sentence</p> <p><strong>This is with strong emphasis</strong></p> <p><em>This line is in italics</em></p>
On your screen, this is what you should see:
This is Header 1
This is my first page.
This is Header 2
- This is the first item
- This is the second item
- This is the third item
This is Header 3
- This is item one
- This is item two
- This is item three
This is Header 4
This is a normal sentence.
This is with strong emphasis.
This line is in italics.
This is Header 5
This is Header 6
Open and Close Tags
Take note of the opening and closing tags.
Every tag opened has to be closed and in order. In the above example, <strong> is opened after <p> and so it has to be closed before we close with the </p> tag.
To refresh your memory, at step 1:
- We started by opening the <html> and closed with </html>.
- Next we opened and closed the head element inside the html.
- We opened and closed the title tag inside the head element
- And finally, we opened and closed the body element after head element.
Some tags like the <p> and the <li> will still be rendered by the browsers if we didn't close them. But it is a good coding habit to close all of them.
Remember this and maintain this habit. You'll be glad you did.
Now, let's go to step 5 of creating my first web page.