Tuesday, June 14, 2011

Tag Attributes


Tags can have attributes. Attributes can provide additional information about the HTML elements on your page.

This tag defines the body element of your HTML page: <body>. With an added bgcolor attribute, tells the browser that the background color of your page should be red, like this: <body bgcolor="red">.
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.

Quote Styles, "red" or 'red'?
Attribute values should always be enclosed 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='ajith "Shot" silva'
The most important tags in HTML are tags that define headings, paragraphs and line breaks.




.

HTML Elements

Recall the HTML example from the previous page:



<html>
<head><
title>Title of page</title>
</head>
<body>This is my first homepage. <b>This text is in bold</b>
</body>
</html>

This is an HTML element:
<b>This text is in bold</b>
The HTML element between start tag: <b>and end tag: </b> defines an HTML element that should be displayed in bold.
This is also an HTML element:

<body>
This is my first homepage. <b>This text is in bold</b>
</body>

This HTML element between start tag <body> and end tag </body> defines the HTML element that contains the body of the HTML document.




.

Sunday, June 12, 2011

HTML Tags

  •  
  • HTML tags are used to mark-up HTML elements
  •            
  • HTML tags are surrounded by the two angle brackets < and >
  •           
  • 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>


.