Live Traffic

Thursday, May 5, 2011

Home » » HTML Tags

HTML Tags

HTML Tags


What are HTML Tags?

  • HTML tags are used to mark-up HTML elements
  • HTML tags are surrounded by the two characters < and >
  • The surrounding characters are called angle brackets
  • HTML tags normally come in pairs like <b> and </b>
  • The first tag in a pair is the start tag, the second tag is the end tag
  • The text between the start and end tags is the element content
  • HTML tags are not case sensitive, <b> means the same as <B>
Logical vs. Physical Tags
In HTML there are both logical tags and physical tags. Logical tags are designed to describe (to the browser) the enclosed text's meaning. An example of a logical tag is the <strong> </strong> tag. By placing text in between these tags you are telling the browser that the text has some greater importance. By default all browsers make the text appear bold when in between the <strong and </strong> tags.

Physical tags on the other hand provide specific instructions on how to display the text they enclose.
Examples of physical tags include :
  • <b> : Makes the text bold.
  • <big> : Makes the text usually one size bigger than what's around it.
  • <i> : Makes text italic.
Physical tags were invented to add style to HTML pages because style sheets were not around, thought the original intention of HTML was to not have physical tags. Rather than use physical tags to style your HTML pages, you should use style sheets.

HTML Elements

Remember the HTML from the previous page :

<html>
<head>
<title>My irst Webpage</title>
</head>
<body>
This is my first homepage. <b>This text is bold</b>
</body>
</html>

This is an HTML element :

<b>This text is bold</b>

The HTML element beginds with a start tag : <b>
The content of the HTML element is : This text is bold
The HTML elemnets ends with an end tag : </b>

The purpose of the <b> tag is to define an HTML element that should be displayed as  bold.

This is also an HTML element :
<body>
This is my first homepage. <b>This text is bold</b>body
</body>
This HTML element starts with the start tag <body>, and ends with the tag </body>. The pupose of the <body> tag is to define the HTML elementthat contains the body of the HTML document.

Nested Tags
You may have noticed in the example above, the <body> tag also contains other tags, like the <b> tab. When you enclose an element in with multiple taggs, the last tag opened should be the first tag closed.
For Example :
<p><b><em>This is NOT the proper way to close nested tags.</p></em></p>
<p><b><em>This is the proper way to close nested tags.</em></b></p>
Note : It doesn't matter which tag is first, but they must be closed in the proper order.

Why Use Lowercase Tags?
YOu may notice we've used lowercase tags even though I saud that HTML tags are not case sensitive. <B> means the same as <b>. The World Wide Web Consortium <W3C>, the group responsible for daveloping web standards, recommends lowercase tags in their HTML 4 recommendation, and XHTML (the next generation HTML) requires lowercase tags.

Tag Attributes
Tags can have attributes. Attributes can provide additional information about the HTML elements on your page. The <tag> tells the browser to do something, while the attribute tells the browser how to do it. For instance, if we add the bgcolor attribute, we can tell the browser that the background color of your page should be blue, like this : <body bgcolor="blue">.

This tag defines an HTML table : <table>. With an added border attribute, you can tell the browser that the table should have no borders : <table border ="0">. Attributes always come in name/value pairs like this : name="value". Attributes are always added to the start tag of an HTML element and the value is surrounded by quotes.

Quote Style, "red" or 'red'?
Attribute values should always be enclose in quotes. Double style quotes are the most common, but single style quotes are also allowed. In some rare situations, like when the attribute value itself contains quotes, it is necessary to use single quotes :

name='George "machine Gun" kellly'

Note : Some tags we will discuss are deprecated, meaning the World Wide Web Consortium (W3C) the governing body that sets HTML, XML, CSS, and other technical standards decided those tags and attributes are marked for deletion in future version of HTML an XHTML. Browser should continue to support deprecated tags and attributes, but eventually these tags are likely to become obsolete and so future support cannot be guaranted.

For a complete list of tags, visit W3C.org




SEE VIDEO


4 komentar:

Thanks the HTML Tag tutorial's

thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with more information? It is extremely helpful for me.
Online Store Creation

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More