What is HTML anyways
Posted on: 12/14/2009 1:06:00 AM
HTML or Hyper Text Markup Language is the language of the web. Every web page that you read is actually just a bunch or HTML markup, JavaScript, and css (Cascading Style Sheet). Today however, we are going to concentrate on just the HTML or xHTML, the latest version of HTML based of XML (eXtensible Markup Language). The difference between the two being that HTML allows for really sloppy markup, doesn't care if you use capitol letters, has self declaring attributes, and doesn't really care if you close out the element, xHTML does care about all of those things. I know that it sounds like a lot of extra stuff to have to worry about, but its really not, and the best part is that your browser still reads in HTML so if your xHTML is not up to par it doesn't really matter that much. From now on I will just refer to everything as HTML so don't get to wrapped up around the whole HTML vs xHTML thing.
HTML is used to define the structure of the page as your browser displays it on your computer. This is important to note because now a days you are suppose to separate content from display. The HTML should say here is a heading, a paragraph, a text box, an image, a button, or whatever else you can think of that you normally see on a web page. The style should then be defined using css classes, but that is another subject altogether. Enough on that lets see some actual HTML in action.
The element you need to know about is the <html> element. The <html> element contains everything that resides on the page. Just look at this sample:
<html>
<head>
<title>The Page Title Goes Here</title>
</head>
<body>
<p>This is a paragraph of text within the body of the page</p>
</body>
</html>
Ok, so I know you are probably thinking wasn't he just talking about the <html> element. What is all of this other junk? It is the bare necessities of a web page and I needed more markup just to show you the syntax of HTML. The first thing you should notice is that everything that you open such as the <html> element, needs to be closed. This is done by adding in a closing tag which is almost the same except that it starts with </ as with the </html> closing tag. Everything from the beginning of <html> to the end of </html> tag is considered the <html> element. The <html> element contains two children elements the <head> element and the <body> element. The <head> element contains information about the page such as the page title, what documents it needs to complete the page, such as style sheets, icons to use, keywords, and the page description. The <body> element on the other had contains what you see within the browser. It consist of a variety of HTML elements and defines the actual content that you see. In the above example all that the <body> element contains is a single paragraph as defined by the <p> element. There are a whole lot more different elements that it could contain.
By now you should have a very basic understanding of what HTML is and how it is used to describe the content of the page. My next tutorial I will go into a lot more depth on the actual markup you use to create your first web page.
|