Computer 7 Unit 1 Chapter 3
Computer 7 Unit 1 Chapter 3
HTML ELEMENTS
An HTML element is defined by a start tag, some
content, and an end tag:
<tagname>Content goes here...</tagname>
<!DOCTYPE html>
<html>
<body>
</body>
</html>
The <html> elem
ent is the root
whole HTML do element and it
cument. defines the
It has a start t
ag <html> and a
Then, inside th n end tag </htm
e <html> elemen l>.
<body> t there is a <body
> element:
<h1>My First H
eading</h1>
<p>My first pa
ragraph.</p>
</body>
The <body> elem
ent defines the
It has a start t document's bo
ag <body> and a dy.
n end tag </bod
y>.
Then, inside the <body> element there is tw
<h1> and <p>: o other elements:
< h 1 > My F i r s t H e a
d in g< /h 1 >
< p> My f ir st p ara
gr ap h .</p >
The <h1> element
defines a heading
It has a start tag .
<h1> and an end ta
< h1> My F ir st H ea g </ h 1 >:
d in g</h 1 >
The <p> element
defines a paragra
It has a start tag ph.
<p> and an end ta
< p > M y f i r st p a r a g </ p >:
gr ap h .< /p >
Some HTML elements will display correctly, even if you
forget the end tag:
<html>
<body>
<p>This is a paragraph
<p>This is a paragraph
N EV ER </body>
EMPTY
ELEMENTS
HTML tags are not case
sensitive:
Tag Description