Introduction
When it comesto HTML elements, you need to first know that
a HTML element is defined by an opening tag, some content,
and a closing tag.
HTML
ELEMENTS
3
4.
Primary goals
To knowwhat HTML tags can do and how to use them while
creating a web page.
5.
• Examples ofsome HTML elements
HTML
ELEMENTS
5
Opening Tag Element Content Closing Tag
<h1> My First Heading </h1>
<p> My first paragraph </p>
<br> none none
6.
Some HTML elementshave no
content (like the <br> element).
These elements are called
empty elements. Empty
elements do not have a closing
tag!
HTML
ELEMENTS
6
7.
Nested HTML elements
PRESENTATIONTITLE
7
HTML elements can be nested (this means that elements
can contain other elements).
All HTML documents consist of nested HTML elements.
Example Explained
HTML
ELEMENTS
9
The <html>element is the root element, and it defines the whole HTML document.
It has a opening tag <html> and a closing tag </html>.
Then, inside the <html> element there is a <body> element:
<body>
<h1>My First Heading</h1>
<p>My first paragraph. </p>
</body>
The <body> element defines the document's body.
It has an opening tag <body> and a closing tag </body>.
Then, inside the <body> element there are two other elements: <h1> and <p>:
10.
EXAMPLE EXPLAINED CONTD.
HTML
ELEMENTS
10
<h1>MyFirst Heading</h1>
<p>My first paragraph. </p>
The <h1> element defines a heading.
It has a opening tag <h1> and a closing tag </h1>
<h1>My First Heading</h1>
The <p> element defines a paragraph.
It has an opening tag <p> and a closing tag </p>:
<p>My first paragraph. </p>
11.
Never Skip theEnd Tag
PRESENTATION TITLE 11
Some HTML elements will display correctly, even if you forget
the end tag
However, never rely on this! Unexpected results and
errors may occur if you forget the end tag!
12.
Empty HTML Elements
PRESENTATIONTITLE 12
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
HTML tags are not case sensitive: <P> means the same as <p>.
The HTML standard does not require lowercase tags, but W3C
recommends lowercase in HTML, and demands lowercase for stricter
document types like XHTML.
13.
Summary
A HTML elementis defined by an opening tag, some content, and a
closing tag. HTML elements can be nested (this means that elements can
contain other elements).HTML tags are not case sensitive. Some HTML
elements will display correctly, even if you forget the end tag.
HTML
ELEMENTS
13