HTML Elements

Elements make up an HTML file. These elements are what make web pages and tell you what content is on them. In HTML, an element is usually made up of a start tag (<tag name>) and an end tag (</tag name>) with content in between. From a technical point of view, an element is made up of a start tag, attributes, an end tag, and content in between.

Some elements don\’t have an end tag or any content. These elements are called \”empty,\” \”self-closing,\” or \”void.\”

Examples:

<p> Your paragraph </p>

Example

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>

<h1>Your Heading</h1>
<p>Your paragraph.</p>

</body>
</html>

On a web page, you can see all the text written between body elements.

Void element: In HTML, all elements don\’t have to have a start tag and an end tag. Elements that don\’t have a start tag or an end tag are called \”void elements\” or \”empty elements.\” Unpaired tag is another name for these elements.

Some Void elements are <br> (represents a line break) , <hr>(represents a horizontal line), etc.

HTML can be nested, which means that one element can hold another element inside it.

HTML elements at the block level and inline

All HTML elements fall into one of two groups when it comes to how they look and how they are displayed by default:

Block-level and Inline HTML elements

 

Block-level element:

These are the elements, which structure main part of web page, by dividing a page into coherent blocks.
A block-level element always start with new line and takes the full width of web page, from left to right.
These elements can have both block-level and inline elements inside of them.

Here are the HTML block-level elements.

<address>, <article>, <aside>, <blockquote>, <canvas>, <dd>, <div>, <dl>, <dt>, <fieldset>, <figcaption>, <figure>, <footer>, <form>, <h1>-<h6>, <header>, <hr>, <li>, <main>, <nav>, <noscript>, <ol>, <output>, <p>, <pre>, <section>, <table>, <tfoot>, <ul> and <video>.

Note: All of these things are talked about in more detail in later chapters.

Inline elements:

Inline elements are those that make a part of a text stand out and give it a specific function.
These elements don\’t start on a new line and take up as much space as they need.
Most of the time, you use Inline elements with other elements.

\”a,\” \”abbr,\” \”acronym,\” \”b,\” \”bdo,\” \”big,\” \”br,\” \”button,\” \”cite,\” \”code,\” \”dfn,\” \”em,\” I \”img,\” \”input,\” \”kbd,\” \”label,\” \”map,\” \”object,\” \”q,\” \”samp,\” \”script,\” \”select,\” \”small,\” \”span,\” \”strong,\” \”sub,\” \”sup\”

Here is a list of some of the most important parts of HTML:

<h1> …… <h6>

These are the headings of HTML. The headings of a page are made with these elements.

<p> This is the paragrapp </p>

This element is used to show text in paragraph format.

<div>

This is the div section.

With this element, you can make a section on a web page.

<br>

This element is used to put a line break between two lines. (void element)

<hr>

This element is used to make a line that goes across the page. (void element)

HTML is Not Case Sensitive

HTML tags don\’t care about case. Both <P> and <p> mean the same thing.

HTML does not require lowercase tags, but the coderazaa recommends them and requires them for stricter document types like XHTML.

Related Posts
Introduction to HTML

HTML Introduction HTML is the most common language used to mark up Web pages. What does HTML mean? Hyper Text Read more

What is HTML

HTML stands for Hyper Text Markup Language, which is a programming language used to make web pages and web apps. Read more

HTML Basic Examples

In this chapter, we\'ll show you some simple examples of HTML code. Don\'t worry if we use tags that you Read more

HTML text Editors

Editors for HTML text HTML files are text files, so any text editor can be used to make them. Text Read more

HTML Tags

Learn HTML Tags HTML tags are kind of like keywords that tell a web browser how to format and show Read more

HTML Attributes

Attribute in HTML Attributes in HTML are special words that tell you more about an element. Attributes change the way Read more

HTML Headings

Headings in HTML The <h1> to <h6> tags are used to set up headings in HTML. <h1> shows which heading Read more

HTML Paragraphs

HTML Paragraphs A paragraph is a block of text that always starts on a new line. The HTML <p> element Read more

Scroll to Top