Skip to main content

HTML Lesson#03 Learn by Naeem Raza

HTML Elements

An HTML element usually consists of a start tag and end tag, with the content inserted in between:
<tagname>Content goes here...</tagname>
The HTML element is everything from the start tag to the end tag:
<p>My first paragraph.</p>
Naeem Raza
html5 by naeem raza




















<!DOCTYPE html>
<html>
<body>

<h1>My First Heading</h1>
<p>My first paragraph.</p>

</body>
</html>


Example Explained

The <html> element defines the whole document.
It has a start tag <html> and an end tag </html>.
The element content is another HTML element (the <body> element).
<html>
<body>

<h1>My First Heading</h1>
<p>My first paragraph.</p>

</body>
</html>

The <body> element defines the document body.
It has a start tag <body> and an end tag </body>.
The element content is two other HTML elements (<h1> and <p>).

<body>

<h1>My First Heading</h1>
<p>My first paragraph.</p>

</body>

The <h1> element defines a heading.
It has a start tag <h1> and an end tag </h1>.
The element content is: My First Heading.

<h1>My First Heading</h1>

The <p> element defines a paragraph.
It has a start tag <p> and an end tag </p>.
The element content is: My first paragraph.
<p>My first paragraph.</p>
Naeem Raza

Do Not Forget the End Tag

Some HTML elements will display correctly, even if you forget the end tag:

<html>
<body>

<p>This is a paragraph
<p>This is a paragraph

</body>
</html>

The example above works in all browsers, because the closing tag is considered optional.
Never rely on this. It might produce unexpected results and/or errors if you forget the end tag.
Naeem Raza

Empty HTML Elements

HTML elements with no content are called empty elements.
<br> is an empty element without a closing tag (the <br> tag defines a line break).
Empty elements can be "closed" in the opening tag like this: <br />.
HTML5 does not require empty elements to be closed. But if you want stricter validation, or if you need to make your document readable by XML parsers, you must close all HTML elements properly.

Naeem Raza

Use Lowercase Tags

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

to be continue.............................. next lesson will be soon by Naeem Raza.

Comments

Popular posts from this blog

Cpp Tutorials

1-Introduction   1.1 Intro To C++   1.2 Advantages and Disadvantages 2-An Example of C++ Program   2.1 Structure of Program 3-Variables and Operators   3.1 Variables   3.2 Variables Scope   3.3 Constants-Literals   3.4 Variables Storage Classes   3.5 Operators 4-Compund Types   4.1 Array   4.2 String   4.3 Pointer   4.4 Structure   4.5 Reference   4.6 Enumration and Type Def 5-Input and Output   5.1 Cout (Output Stream)   5.2 Cin  (Input Stream)   5.3 Cerr (Error Stream)   5.4 Clog (Log Stream) 6-Flow of Control 6.1 Conditional Branching if 6.2 Conditional Selection Switch 6.3 Loop-While and For 6.4 Break and Continue 6.5 Random Number 7-Functions   7.1 Function Basics   7.2 Declaration ,Call and Arguments   7.3 Inline Function   7.4 Recursion 8-Object Oriented Approach   8.1 Classes Basics   8.2 Cons...

Start Your Online Store

Start Your Online Store -Call:+92300-8339030 100% Mobile Solution The Storefront and admin are designed to be responsive and are optimized for various computer screen sizes as well as mobile and tablet devices to keep your eCommerce always at your fingertips SEO Friendly eCommerce The Storefront is effectively search engine optimized, to rank your site and product information top on google. The Mobile version is equally Google optimized. t’s easy to learn and simple to use There is no special training or knowledge required to start selling your products online using OurCart. The voice controlled and easy-to-use intuitive interface makes your eCommerce management a breeze. Start Your Online Store -Call:+92 300-8339030 Feature-rich OurCart is equipped with many out-of-the-box enterprise grade features. We are continuously seeking ways to expand the software to improve your eCommerce experience. Innovative Technology OurCart shopping car...

Enhance Your Seo Tutorials Skills During Your Lunch Break! Episode-01

Enhance Your Seo Tutorials Skills During Your Lunch Break!Episode-01   Website improvement (Web optimization) is the action of upgrading site pages or entire locales to make them internet searcher cordial, hence getting higher situations in indexed lists. This instructional exercise discloses straightforward Website design enhancement procedures to improve the permeability of your pages for various web indexes, particularly for Google, Yippee, and Bing.  Who Can Learn S.E.O This instructional exercise has been ready for fledglings to assist them with understanding the straightforward yet powerful Web optimization (S.E.O) qualities. Essentials Requirement for Learning SEO We expect you know about straightforward web advancements, for example, HTML, XHTML, Template, and so forth On the off chance that you as of now have built up any site, at that point it is an additional preferred position and it will assist you with understanding the ideas of Search engine optimization clarif...