the instructions provided were:
Below the h1
element, add an h2
element with this text:
Cat Photos
And originally, the line of code provided to you was this one:
<h1>CatPhotoApp</h1>
Okay, so what were you given? You were given some text “CatPhotoApp” which was tagged with an h1 tag (HTML tags go on the left and right of the text they are marking up).
Another example of some text with HTML h1 tag markup is this:
<h1>I am the text that will be displayed as a header</h1>
So notice what the h1 tag does to the text. If you write an html file with only words in it, the browser displays it plainly. Like this:
CatPhotoApp
But if you apply a tag to it (in this case the h1 tag) it will be transformed to look differently like this
CatPhotoApp
That’s cool right? Okay so that was done with just adding <h1>
to the left of the text and </h1>
to the right. Pay close attention to the way I wrote that.
On the left it was <h1>
On the right it was </h1>
Great, now we want to learn a new tag called the h2 tag and it looks like this:
<h2>This is some text I want to mark up</h2>
Do you notice that it looks exactly the same as the h1 tag ? The only difference is that we use h2 instead of h1.
This h2 tag makes the text look big but not as big as an h1 tag.
Now that you know this, refer back to the instructions (pasted here for convenience):
Below the h1
element, add an h2
element with this text:
Cat Photos
And originally, the line of code provided to you was this one:
<h1>CatPhotoApp</h1>
So the instructions say “below the h1 tag” This sentence means you should add a new line under the one provided to you.
Then you need to add the h2 tag with the words Cat Photos
in the middle of the starting (left-side) tag and the ending (right-side) of the tag.
If you do it right you will see the words appear below the given ones in the preview area like this:
CatPhotoApp
Cat Photos
Give it a try…