Search This Blog

Wednesday, June 9, 2021

HTML Elements

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: Content goes here... Examples of some HTML elements:

My First Heading

My first paragraph.

Start tag Element content End tag

My First Heading

My first paragraph.


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

:

My first paragraph.

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 COMMNET US IF YOU WANT TO LEARN CODING OR HTML

No comments:

Post a Comment

अगर आपके लैपटॉप में आवाज़ नहीं आ रही है, तो इन चरणों का पालन करें! No sound in laptop

1. वॉल्यूम स्तर जांचें : सुनिश्चित करें कि वॉल्यूम म्यूट नहीं है या बहुत कम पर सेट नहीं है। आप टास्कबार में ध्वनि आइ...