HTML elements

Posted: June 6, 2012 by makaranddalal in HTML

HTML Elements

It  is everything from the start tag to the end tag:

  • Example 1: [ <p>Hello guys</p> ]—-> This whole sentence is called an element
  • Example 2:[ <br /> ]—-> It is an empty content example.Empty elements are closed in start tag itself as shown here.

Nested HTML Elements

The below example consist of 4 html elements:


<!DOCTYPE html>
<html>

<body>
<h2> Engineering adda </h2>

<p>Welcome to Engineering adda </p>
</body>

</html>


o/p

Elements output


Explanation:

  • <h2> Engineering adda </h2>:The <h2> element defines the heading in html document
  • <p>Welcome to Engineering adda </p>:The <p> element defines the paragraph in html document
  • “<body>
    <h2> Engineering adda </h2><p>Welcome to Engineering adda </p>
    </body>”

The <body> element defines the body of html document

  • The <html> element defines the whole html document

Note:

Never forget to close Tag .Most of the browser supports this but some times may generate unexpected Results.

HTML tags are not Case-Sensitive, but it is always better to use lowercase.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s