0% found this document useful (0 votes)
6 views

Computer 7 Unit 1 Chapter 3

Uploaded by

marvin prianes
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Computer 7 Unit 1 Chapter 3

Uploaded by

marvin prianes
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 9

HT ML E L E ME N T S

HTML ELEMENTS
An HTML element is defined by a start tag, some
content, and an end tag:
<tagname>Content goes here...</tagname>

The HTML element is everything from the start tag to


the end tag:

<h1>My First Heading</h1>


<p>My first paragraph.</p>
NESTED HTML ELEMENTS
HTML elements can be nested (this means that elements can
contain other elements). All HTML documents consist of nested
HTML elements.
The following example contains four HTML elements
(<html>, <body>, <h1> and <p>):

<!DOCTYPE html>
<html>
<body>

<h1>My First Heading</h1>


<p>My first paragraph.</p>

</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>

SKIP THE </html>


Unexpected results and errors may occur if you
END TAG forget the end tag!
HTML elements with no content are called
empty elements.

The <br> tag defines a line break, and is


an empty element without a closing tag:
<p>This is a <br> paragraph with a line
break.</p>

EMPTY
ELEMENTS
HTML tags are not case
sensitive:

<P> means the same as <p>.

HTML IS NOT CASE


SENSITIVE
HTML TAG REFERENCE

Tag Description

<html> Defines the root of an HTML document

<body> Defines the document's body

<h1> to <h6> Defines HTML headings

You might also like