Site Sponsors

Archive for the ‘Tags’ Category

html tag: abbr

Saturday, April 5th, 2008

abbr is short for abbreviation, an abbreviation is a shortened form of a word or phrase. Usually it consists of a letter or group of letters taken from the word or phrase. For example “HTML” is short for HyperText Markup Language.

abbr attributes

  • title - the title attribute is used to show the complete phrase or abbreviation

abbr example

 <abbr title="HyperText Markup Language">HTML</abbr>

The above example will give us the following: HTML (mouseover the HTML text)

Note: The abbr tag is not recognised by Internet Explorer.

html tag: acronym

Thursday, March 27th, 2008

acronyms are abbreviations that are formed using the initial components in a phrase or name for example HTML is short for Hyper Text Markup Language.

acronyms are generally used to help the acronym stand out more and allow more information to be displayed when mousing over, just like the title attribute in the anchor tags.

Acronym attributes

  • title - the title attribute is used to show the complete phrase or abbreviation

Acronym example

 <acronym title="HyperText Markup Language">HTML</acronym>

The above example will give us the following: HTML (mouseover the HTML text)

html tag: blockquote

Wednesday, February 6th, 2008

The blockquote is used for large quotations. Within the blockquote element there must be a block-level element eg. <p>, <div>, <ul>, <ol> etc.

Possible blockquote attributes

  • cite is used to specify the URL where the quote has come from.

Blockquote Example

    <blockquote>
		<p>
			Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quisque tortor neque, accumsan vel, convallis in, pulvinar id, ipsum.
		</p>
    </blockquote>

html tag: head

Friday, January 11th, 2008

The head is where all the information about the document is contained.

Information which is displayed in the header would are; the title of the site (this is compulsory), meta, style, scripts and link.

The opening of the head tag is to start immediately after the html and close directly before the start of the body tag.

Example

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link type=”text/css” rel=”stylesheet” href=”style.css” />
 </head>
     <body>
          <p>Hello World!!</p>
     </body>
</html>

html tag: body

Wednesday, January 9th, 2008

The body tag is again one of the most important tags when writing a HTML document. The body tag contains the body content of the site. eg text, images, links, tables etc.

The body tag comes immediately after the closing of the head tag (</head>) and closes immediately before the closing of the html tag (</html>).

Example

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link type=”text/css” rel=”stylesheet” href=”style.css” />
 </head>
     <body>
          <p>Hello World!!</p>

     </body>
</html>

html tag: link

Monday, January 7th, 2008

The link tag helps us reference an external file such as a CSS file.

The link tag must only appear in between the head tags.

Example

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link type=”text/css” rel=”stylesheet” href=”style.css” />
 </head>
     <body>
          <p>Hello World!!</p>

     </body>
</html>

Additional Atributes

(not required)
Most commonly used:

  • href - specifies the link to the external file eg. href=”style.css”
  • type - this specifies the type of file you are linking to eg. type=”text/css”
  • rel - specifies relationship to the linked file eg. rel=”stylesheet”
  • media - specifies media type the linked file is to be used for eg. media=”screen” or media=”print”. You can have multiple media types under one attribute e.g media=”screen, print, projector”

Other

  • charset - specifies the characterset of the externally link file eg. charset =”UTF-8″
  • hreflang - this specifies the language of the external linked page eg. type=”en-us” (English - United States)

html tag: html

Sunday, January 6th, 2008

The html tag is what helps structure the document and define the rest of the content as being html.

The opening tag is the first tag within the file immediatley below the <!DOCTYPE> and the closing tag is the very last tag on the page to close the html document.

Within the html tags you must also have the following tags: head & body

Requirements

xmlns is used to define the XML namespace.

Example

Using our index.html example again (found here), we can add the necessary tags.

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

 </head>
     <body>
          Hello World!!
     </body>
</html>