Thursday, October 21, 2010

Tags, Attributes, and Elements. (The stuff that makes up HTML)

html2 A – Tags.
  • The basic structure of an HTML document includes tags, which surround content and apply meaning to it.

  • Change the first code with this code

  • <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  • "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  • <html>
  • <head>
  • <title> the first page </title>
  • </head>
  • <body>
  • Welcome to my first page
  • </body>
  • </html>
  • And back now to the browser and refresh the page. Nothing will be change but the purpose of HTML s to apply meaning. And this example has now defined some fundamental elements of a web page.

  • The first line on the top that starts <!DOCTYPE... is to let the browser know that you know what you're doing.

  • <html> opening tag tells the browser that everything between <html> and closing tag </html> is a HTML document. The stuff between <body> and </body> is the main content of the document that will appear in the browser window.

B – Closing Tags.
  • The </body> and </html> close their respective tags. ALL HTML tags should be closed. Although older versions of HTML lazily allowed some tags not to be closed, latest standards require all tags to be closed.

  • Some tags, which do not wrap around content, will close themselves. The line-break tag for example, looks like this : <br />.

C – Attributes.
  • Tags can also have attributes, which are extra bits of information. Attributes appear inside the opening tag and their value is always inside quotation marks. They look something like <tag attribute="value">Margarine</tag>.

D – Elements.
  • Elements are the bits that make up web pages. You would say, for example, that everything that is in-between and includes the <body> and </body> tags is the body element.

0 comments:

Post a Comment

 

Popular Posts

W3OnSet Copyright © 2011 Community is Designed by Sacha Blogger Template

CSS done by Link building