HTML Elements
HTML elements are a tool you can use to change what your text looks like and how it is arranged on the page.
I feel like just having
Calamondins are delicious!
in plain text doesn't really capture how
delicious they are, so let's add some flavor to
our text with the em
element.
This time, instead of
Calamondins are delicious!
,
put Calamondins are <em>delicious!</em>
into the editor.
When you're done, the preview should look like this:
There, that gets you more of the feeling of just how emphatically delicious they are, right? Ugh, so delicious.
I think I'll go eat one right now.
Anyway, where was I?
Oh, right, so the em
HTML element
we used here starts with
<em>
and ends with
</em>
.
<em>
and
</em>
won't show up on the page, but they will
tell your
browser to add emphasis
to everything that's in between them. That's why
when you're done, the word "delicious" will be
in italics in the preview.
The Anatomy of an Element
In Calamondins are <em>delicious!</em>
,
the em
element is made up of three
things.
-
Opening tag:
<em>
-
Content:
delicious!
-
Closing tag:
</em>
And all these things combined — opening tag,
content, and closing tag—are called an HTML
element:
<em>delicious!</em>
.
Now that you've made your first element, let's take it to the next level: click here to go to the next step: Grouping and Nesting HTML elements.