> > HTML Tags

HTML Tags

Posted on Monday, September 24, 2012 | No Comments

HTML Tags

HTML tags are common naming for HTML markup tags.
  •  HTML tags are keywords for HTML language and define inside of angle brackets like <html>
  • Generally HTML tags are come in pairs like <p> and </p>
  • The first tag of a pair called start tag or opening tag, the second tag called end tag or closing tag.
  • The end tag written same as start tag including forward slash before the tag name.

<starttag>content</endtag>

HTML Elements

HTML Elements and HTML tags are often used to define same things.
Even though HTML Element is anything between opening tag and closing tag, containing the tags.

HTML Element:
<p>a paragraph</p>

 

Code Sample

<!DOCTYPE html>

<html>

<body>

<h1>HTML Heading tag</h1>

<p>HTML paragraph tag</p>

<div>HTML division tag</div>

</body>

</html>

 Example explained:

 

  • <!DOCTYPE html> DOCTYPE defines the document type.
  • Between the start tag <html> and end tag </html> describe the web page.
  • Between the start tag <body> and end tag </body> text is visible contents of the web page.
  • Between the start tag <h1> and end tag </h1> text is a heading.
  • Between the start tag <p> and end tag </p> text is a paragraph.
  • Between the start tag <div> and end tag </div> define a division.  

 The <!DOCTYPE> Declaration

 

<!DOCTYPE> Declaration is a most important thing when developing a web site because there are various HTML types and versions to provide 100% correct web page browser need to identify which HTML version and type used in web page.

Common Declarations

HTML5 

<!DOCTYPE html>

HTML 4.01

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

XHTML 1.0

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Leave a Reply

Powered by Blogger.