Skip to main content

HTML Elements

 HTML Elements

An HTML element is defined by a start tag, some content, and end tag.

The HTML element is everything from the start tag to the end tag:



<tag name> Content goes here....</tag name>

Examples:
<h1>First heading</h1>
<p> First paragraph</p>

Starting tag: <h1>
Ending tag: </h1> 
Element content: First heading

Note: Some elements have no content (like the <br> 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 element can obtain other elements).
All HTML documents consist of nested HTML elements. 
The following example consist four HTML elements(<html>, <body>, <h1> an d <p>).

<!DOCTYPE html>
<html>
<body>

<h1>First heading</h1>
<p>First paragraph</p>

</body>
</html>

Example explained
The <html> element is the root element  and it defines the whole HTML document.
It has a start tag and an ending tag </html>.
Then, inside the <html> element there is a <body> element:

<body>

<h1>First heading</h1>
<p>First paragraph</p>

</body>

The <body> element defines the document's body.
It has a start tag <body> and an end tag </body>.

The <h1> element defines a heading.
It has a start tag <h1> and an end tag </h1>.

The <p> element defines a paragraph.
It has a start tag <p> and an end tag </p>.

Empty HTML Elements

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 is not case sensitive

HTML tags are not case sensitive: <P> means the same as <p>.
The HTML standard does not require lowercase tags, but I recommends lowercase in HTML, and demands lowercase for stricter document types like XHTML. 

Thanks for visit

Comments

Popular posts from this blog

Java programming language.

Hi, If you want to know about Java language then it is right place for you. Some points about Java language.  It is developed by James Gosling at sun microsystem.  It is release in 1995 as a Core. It is a general purpose programming language. It is like c ++ but with advanced and simplified features. Concurrently execute many statement. It is object oriented programming language.  It is platform independent. Installation process.                    Download JDK Mac OS ~ JDK version 11. WINDOWS ~ 32 Bits JDK version 8.                    ~ 64 Bits JDK version 11. Wants to download JDK click here .  Download Eclipse for easy programming😊😊. Download eclipse  click here .  Data types in java?  There is two type of data types in java primitive data types and non primitive data types. Firstly we talk about primitive data ty...

Why should we learn Python ? | Python learning.

| Python Python is high level programming language, by the use of python we create complex computer programs. Python is also known as interpreted language. |  Python used in various fields     Python can be used in different ways such as: Software developers Data scientists Data Analysts Hackers Bankers Engineers Designers Doctors Scientists, etc. | Why Python is known as Python? Python is named after a comic series. Guido Van Rossum is the creator of Python. Python is an easy programming language, using python the complex programs can be written.   |  Advantages of Python Python can be used online, offline. A nd Python can be used in Smaller or big projects. Python is an Interpreter language, where Programs can be executed directly without complier.   |  Applications of Python Web application. Mathematical Computations. Graphical User Interface. And may more.....   Thanks for visit!!!

Difference between HTML, CSS and Java Script

Difference between HTML, CSS and Java Script HTML/XHTML HTML (HyperText Markup Langage) is the language used to create web page documents. The updated version, XHTML (eXtensible HTML) is essentially the same language with stricter syntax rules.It is common to see HTML and XHTML referred to collectively as (X)HTML, as (X)HTML is not a programming language; it is a markup language, which means it is a system for identifying and describing the various components of a document such as headings, paragraphs, and lists. You don’t need programming skills—only patience and common sense—to write (X)HTML. Everyone involved with the Web needs a basic understanding of how HTML works. The best way to learn is to write out some pages by hand, If you end up working in web pr...