Pages

Thursday, October 28, 2010

Introduction To HTML

HTML stands for HyperText Markup Language, which is the language used to create webpages. It is a unique code that tells your web browser how to display information, and is the basis of any website. But enough about that, here's how you use it!
HTML is made up of "tags." A tag is a command, usually in the following format:
<command>this text is affected by the tag</command>
A tag with a / is a closing tag, which follows an opening tag. Here is an example:
<b>text</b>
<b> is an opening tag, it makes text bold. </b> ends the bold text. In effect, the closing tag tells the browser when it should stop processing the opening tag.
The majority of HTML tags do require both opening and closing tags. A few more examples are below:
CommandCodeCode in TagResult
boldb<b>text</b>text
italici<i>text</i>text
preformattedpre<pre>text</pre>
text
paragraphp<p>text</p>
text
There are also tags that don't require closing tags, and are meant to be used alone. Here are a few common ones:
TagUseResult      
<br>This adds a break after a line and begins a new line. HTML doesn't recognize normal text formatting.line 1
line 2
<hr>This puts a line/bar across the page. Used to seperate sections of the page.
<img>This puts an image in the page. Click the link to learn more.Click
So how do you put all these together into a HTML page? By using the following format. Begin every page with the following tags:
<html>
<body>
<html> tells the browser that it is a HTML page. The contents of the page go after <body>.
After the content, close the page like so:
</body>
</html>
Makes sense, doesn't it? So, a sample HTML page code would look something like this:
<html>
<body>

<b>welcome to my page</b>
<hr>

it is my first try, so
<br>
<i>i hope you enjoy your stay</i>

</body>
</html>

0 Comments:

Post a Comment