- HTML Elements
- HTML Elements
- Nested HTML Elements
- Example
- My First Heading
- Example Explained
- My First Heading
- My First Heading
- and an end tag
- My First Heading
- Never Skip the End Tag
- Example
- Empty HTML Elements
- Example
- HTML is Not Case Sensitive
- HTML Tag Reference
- HTML Elements
- Heading elements are used to provide a heading to articles on your web page. Line break is used to provide carriage return or going to the next line.
- Heading elements are used to provide a heading to articles on your web page.
- Difference Between Tags and Elements
- Nested HTML Elements
- HEADING Elements or Elements
- Why Are the Heading Elements Important?
- HTML Page Elements – Explained for Beginners
- What Does HTML Do?
- Understanding HTML Page Structure
- What’s in the section of your HTML code?
- Understanding Semantic Tags
HTML Elements
An HTML element is defined by a start tag, some content, and an end tag.
HTML Elements
The HTML element is everything from the start tag to the end tag:
Examples of some HTML elements:
Note: Some HTML elements have no content (like the
element). These elements are called empty elements. Empty elements do not have an end tag!
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 ( , , and
):
Example
My First Heading
My first paragraph.
Example Explained
The element is the root element and it defines the whole HTML document.
It has a start tag and an end tag .
Then, inside the element there is a element:
My First Heading
My first paragraph.
The element defines the document’s body.
It has a start tag
and an end tag .Then, inside the element there are two other elements: and
:
My First Heading
My first paragraph.
The element defines a heading.
It has a start tag
and an end tag
:
My First Heading
The
element defines a paragraph.
It has a start tag
and an end tag
:
Never Skip the End Tag
Some HTML elements will display correctly, even if you forget the end tag:
Example
This is a paragraph
This is a paragraph
However, never rely on this! Unexpected results and errors may occur if you forget the end tag!
Empty HTML Elements
HTML elements with no content are called empty elements.
The
tag defines a line break, and is an empty element without a closing tag:
Example
This is a
paragraph with a line break.
HTML is Not Case Sensitive
HTML tags are not case sensitive: means the same as
.
The HTML standard does not require lowercase tags, but W3C recommends lowercase in HTML, and demands lowercase for stricter document types like XHTML.
At W3Schools we always use lowercase tag names.
HTML Tag Reference
W3Schools’ tag reference contains additional information about these tags and their attributes.
Tag | Description |
---|---|
Defines the root of an HTML document | |
Defines the document’s body | |
to | Defines HTML headings |
For a complete list of all available HTML tags, visit our HTML Tag Reference.
HTML Elements
HTML elements are the names of the starting tags of your HTML code. When you find an element containing additional content, you will see that it ends up using a closing tag with a forward slash with the element’s name. HTML Elements is a combination of HTML tags and content. The HTML element is between the start tag and the end tag; This is called an HTML element; It is important to have your content in it; Otherwise, it will be called only a tag. Here are some of the common examples of elements and how they are written:
- Difference Between Tags and Elements
- Nested HTML Elements
- HEADING Elements or Elements
- Why Are the Heading Elements Important?
Difference Between Tags and Elements
This is one of the most famous HTML questions: What might be the actual difference between a tag and an element? You can say that an HTML element consists of a starting tag always. When the HTML element holds sub-content or some other content within it, it will end up with an ending tag.
Nested HTML Elements
Elements can be nested, which means you can write an element, and before closing that element, you can start and finish another element within that outer element. It’s very much possible to keep one element within another. Here’s a simple example of such a situation:
This is my paragraph text with bold word.
Here the …. is used to make your text bold. Here paragraph tag acts as an outer element, and a strong tag acts as an inner element, which can be called nesting of elements.
HEADING Elements or Elements
Any content or article has a nice heading that provides the document’s title or the subject’s name. Similarly, in HTML code, different heading sizes can be given on your web page. HTML allows six sizes for heading that uses elements name in the format of , where n starts from 1 till 6; like this:
It is to be noted that when you implement any heading tag, the web browser will automatically add one line prior and one line following that heading to make the heading look neat.
This is page heading of size 2.
This is heading of size 3.
This is heading of size 5.
Why Are the Heading Elements Important?
Heading plays an essential role as search engines usually use headings to index the web page’s structure and content. Moreover, headings can make web articles more readable and neat.
HTML Page Elements – Explained for Beginners
David Clinton
HTML, which stands for Hypertext Markup Language, is the standard markup language used for creating web pages and structuring their content on the World Wide Web.
HTML serves as the backbone of web development and acts as a fundamental building block for creating web-based documents. Let’s take a quick look at how it works.
What Does HTML Do?
The main role of HTML is to define the structure and layout of a web page by using a set of tags or elements. These tags represent different types of content such as headings, paragraphs, images, links, forms, and tables.
HTML tags are enclosed in angle brackets (<>) and are composed of an opening tag, content, and a closing tag (which is identified by its forward slash — «/»).
This article comes from my Complete LPI Web Development Essentials Study Guide course. If you’d like, you can follow the video version here:
By using HTML, web developers can define the semantic structure of a webpage, specifying elements like headings, paragraphs, lists, and sections. Here’s a typical example of an HTML page with , , , and sections clearly identified:
Additionally, HTML allows for the inclusion of multimedia content like images and videos. It also lets you integrate other web technologies such as CSS (Cascading Style Sheets) for styling, and JavaScript for interactivity.
Here’s an example code snippet showing an image and a video being incorporated into a web page.
HTML documents are interpreted by web browsers, which render the structured content and present it to users. It enables browsers to understand the hierarchy, relationships, and presentation of elements on a webpage. It ensures that everything displays as intended and that there’s appropriate interactivity.
In this guide, we’re going to explore the core HTML elements, including document structure, external links, embedded media, and simple forms. And we’re going to do all that by actually creating stuff. No more boring slides.
Understanding HTML Page Structure
Ok. The basic structure of an HTML document, sometimes described as the HTML skeleton, provides a foundation for creating web pages. It consists of several essential elements that establish the structure and define the content of the page.
When I right-click on a page, I can select the View Page Source option and I’ll find myself looking at the HTML source code.
Well begin at the top. The Document Type Declaration () is placed at the very beginning of an HTML document to specify the HTML version being used. It ensures that the browser interprets the page correctly.
The HTML tag is the root element of an HTML document. It encloses the entire content of the page and serves as a container for all other HTML elements.
If you scroll all the way to the bottom of a page, you’ll see a closing tag like this: