LiveWire Network Peer Answers Peer Support Teen Forums Tech Forums College Forums 419 users online 225378 members 544 active today Advertise Here Sign In
TeenCollegeTechPhotos | Quizzes | LiveSecret | Memberlist | Dictionary | News | FAQ
Member Spotlight
RuffedUp
It's true. I never post.
Mood: Moody
You have 1 new message.
Emergency Help
Until you sign up you can't do much. Yes, it's free.

Sign Up Now
Membername:
Password:
Already have an account?
Invite Friends
Active Members
Groups
Contests
Moderators
2 online / 42 MPM
Fresh Topics
  LiveWire / Technical Forums / Web Design & Search Engine Optimization / Adding Reply

Quoting Post
Topic An Introduction to HTML
Membername   Not a member? Sign Up Free (takes 20 seconds)
Password   Forgotten your password?
Post

Font:   Size:   Color:

FAQ Keyword Search:
Post Options
Favorites Manager
Notify me of new replies to this topic by email
Notify me of new replies to this topic by private message
Original Post
Moridin Posted at 5:26 pm on July 24, 2006
[SIZE=7]Introduction to HTML[/SIZE]

HTML stands for Hyper Text Markup Language and is the most commonly used language on the web. It consists of markup tags and tells a browser how to display text. This the basic structure of an HTML document:

Code:
<html>
<head>
<title>Title_of_website</title>
</head>
<body>
This is the body of the document. <u>This text is underlined.</u>
</body>
</html>

The first tag in your HTML document is <html>. This marks the start of the HTML Document. </html> marks the end of it. The text within the header tags (<head> and </head>) does not appear in your browser. It is used for code that will change the look or function of the website as a whole. The text in-between the <title> tags will be displayed at the very top left of your browser. Everything found between the <body> tags is, as the name implies, the body of your HTML Document. This is what will show in your browser. The text located between the <u> tags will become underlined.

[SIZE=4]How do I use HTML?[/SIZE]

Well, you could either use HTML on your own computer or on a testbed. If you want to use a test bed, try J Marshall HTML Test Bed.

The following will show you how to try HTML on your own computer. Note that this is for Windows only.
Create a new text document on your desktop. This can be done by right clicking -> New -> Text Document. Open it and paste the above HTML into it. Save it by going File -> Save As. Save the page as "something.html". Close it and open it in a browser (by double clicking on it). Now, your browser will display the page.

If you are browsing a web site and suddenly wonder something along the lines of "How did they do that?", there is an easy solution at hand. Simply right-click and choose View Page Source (on firefox) or View Source (on Internet Explorer). The short cut is Ctrl + U. This will allow you to see the source code that was used to create the web site. This is a great way to learn. Although it is a bad habit to try and memorize HTML tags, there are still a few you need to learn.

[SIZE=4]Bold[/SIZE]

Sometimes you might want to make text more visible because you need them to be more important in the context etc. Then you should make them in bold. To make text in bold, simply but bold tags around it like this:

<b>This text is bold</b>

[SIZE=4]Italic[/SIZE]

Another powerful way of making text stand out as an important word is by making it italic. To make text italic, just put italic tags around it like this:

<i>This text is italic</i>

[SIZE=4]Underlined[/SIZE]

As you have seen in the example above, to make something underlined:

<u>This text is underlined</u>

[SIZE=4]Headings[/SIZE]

Perhaps the most important thing in a document is headings. This separates sections from each other and makes it easy to find what you are looking for. Headings are defined with the <h1> to <h6> tags. The higher the number the smaller the heading.

<h1>This is a heading</h1>
<h2>This is a heading</h2>
<h3>This is a heading</h3>
<h4>This is a heading</h4>
<h5>This is a heading</h5>
<h6>This is a heading</h6>

[SIZE=4]Paragraphs[/SIZE]

To space out the different sections of a website, paragraphs are often used. This allows the user to easily read text and find what he or she is looking for. To make a paragraph, do this:

<p>This is a paragraph</p>

[SIZE=4]Line Breaker and Horizontal Rule[/SIZE]

A line breaker and a horizontal rule is both used to separate sections from one and another. They both use one tag only, but in the future, single tags must be closed as well, so that is what will be shown here.

A line breaker is used if you want to end a line, but not end a paragraph. Using the line breaker tag, the current line will break and another will begin. The line breaker tag looks like this (notice the space before the slash):

<br />

A horizontal rule on the other hand, will insert a line in your page. This can be a useful tool to separate sections.The tag looks like this (notice the space before the slash):

<hr />

[SIZE=4]Images[/SIZE]

If you want to display an image, you should use this HTML code:

<img src="URL_to_image" alt="If_your_image_do_not_show_this_text_will_show_instead" />

URL_to_image can be http://img364.imageshack.us/img364/893/b4nn3rhdgf6.jpg and so on.

[SIZE=4]Alignment[/SIZE]

Although you are required to use CSS if you want to use images in the newest "version" of HTML (XHTML 1.0 Strickt) you can use the following for any other "version" of HTML.

Left:

<div align="left">Item_that_you_want_to_be_aligned_to_the_left_here</div>

Center:

<div align="center">Item_that_you_want_to_be_aligned_to_the_left_here</div>

Right:

<div align="right">Item_that_you_want_to_be_aligned_to_the_left_here</div>

[SIZE=4]Links[/SIZE]

The HTML for the most basic hyperlinks looks this:

<a href="URL">Link Description</a>

Where URL is the URL (or "address") to the website you want to link to and "Link Description" is the text that you want to be displayed.

Let's say that you would want to create link to Google with the description "Search with Google!", your code would look like this:

<a href="http://www.google.com";>Search with Google!<a>

Which would give the following result:

Search with Google!

[SIZE=4]Font size[/SIZE]

There is no valid (X)HTML for font size, so we need to use (inline) CSS:

<span style="font-size: 150%">Text_that_you_want_in_another_size_here</span>

The above will make the text 150% bigger than it normally would be. The number can be just about any percentage.

[SIZE=4]Font color[/SIZE]

There is no valid (X)HTML for font size, so we need to use (inline) CSS:

<span style="font-color:red">text_in_red_here</span>

Change red to the color you want to have.

[SIZE=4]Background color[/SIZE]

The easiest way to add a background color is simply to add bgcolor="color" to your body tag like this:

Code:
<body bgcolor="red">

The above will give your website a red background color.

-or-

However, there is no valid (X)HTML for background color either, so we need to use CSS again!

Code:
<html>
<head>
<title>Title_of_website</title>
<style type="text/css">
body
{
background-color:red;
}
</style>
</head>
<body>

Content of your website here

</body>
</html>

The above code will make the background color of your website red. Just change red to the color that you want your background color to be and it will.

[SIZE=4]Background image[/SIZE]

The easiest way to add a background image is simply to add background="URL_to_image_here"> to your body tag like this:

Code:
<body background="http://www.w3schools.com/html/background.jpg";>

The above will give your website a the background image that can be found by clicking this link http://www.w3schools.com/html/background.jpg.

-or-

However, there is no valid (X)HTML for background image either, so we need to use CSS again!


Code:
<html>
<head>
<title>Title_of_website</title>
<style type="text/css">
body
{
background-image: url(URL_to_image_here);
}
</style>
</head>
<body>

Content of your website here

</body>
</html>

where URL_to_image is the URL (or "address") to your image.

[SIZE=4]Some final advice[/SIZE]


  • Always close tags! Sometimes you can just use the start tag of an element and it will work just fine. This is a very bad habit as it can lower the functionality of your website. In a not-so-distant future, open tags will not be allowed at all. People laugh at other people not using valid HTML.
  • Use lowercase HTML and not UPPERCASE.
  • Use Correct Nesting! If you want to make a text both underlined and bold, make sure that they come in the right order. <b><u>text</u></b> is correct while <b><u>text</b></u> is not.
  • NEVER use the HTML to display your email, becuase bots crawl websites collecting them and adding them to mailing lists for spam and/or virus and so on. Use and image or something [at] nothing [dot] com.
Moridin of LiveWire and Realm of Science. All rights reserved. No part of this text may be reproduced without the direct written consent of its author.

(Edited by Moridin at 3:32 pm on July 25, 2006)

(Edited by Moridin at 11:48 pm on July 25, 2006)

Replies
Jasna88 Posted at 10:56 am on Nov. 10, 2009
I started learning html like 2 weeks ago..........my bf has more then 10 years of experience in that.....i have long way to go i guess
jamieevans11 Posted at 11:31 pm on Jan. 20, 2009
Quote: from Irin at 4:02 am on Aug. 21, 2007

Can anyone help me with meta tags ???????  

<head>

<title>Site name - Page title - Keyword description</title>

<meta name="description" content="A blurb to describe the content of the page appears here" />

<meta name="keywords" content="wikipedia,encyclopedia" />

</head>

jamesshadowwolf Posted at 10:31 pm on Dec. 1, 2008
Copy and Paste into an HTML on your Personal Webpage Please!

Code:
<a href="http://www.support4teens.lefora.com/forum/"; target="_blank"><img src="http://img111.imageshack.us/img111/6161/mybanner4934cce7441c9um4.png"; alt='Create your own banner at mybannermaker.com!' border=0 /></a><br>Copy this code to your website to display this banner!<br><textarea cols="40" rows="2"><a href="http://www.support4teens.lefora.com/forum/"; target="_blank"><img src="http://img111.imageshack.us/img111/6161/mybanner4934cce7441c9um4.png"; alt='Create your own banner at mybannermaker.com!' border=0 /></a><br><a href="http://www.mybannermaker.com/";>Make your own banner at MyBannerMaker.com!</a></textarea>

rand0mguy Posted at 8:13 pm on April 29, 2008
hmmm so are you meaning html or xhtml cuz theres a bit of both like <br /> is xhtml. and you are using a mixture of valid css styles and old deprecated html style like <body background="
Matthew14 Posted at 4:48 pm on Mar. 9, 2008
Very nice.
rand0mguy Posted at 11:28 pm on Jan. 7, 2008
arnt some of those elements deprecated in favour of css styles
Link01 Posted at 9:31 am on Sep. 12, 2007
i want to get music in it how?
Irin Posted at 4:02 am on Aug. 21, 2007
Can anyone help me with meta tags ???????

Irin
http://delnaz.livejournal.com/

Dexus Posted at 9:19 pm on Sep. 9, 2006
Very nice indeed.
dbzfreak Posted at 1:20 pm on Aug. 12, 2006
very helpful
Moridin Posted at 12:46 pm on Aug. 1, 2006
Quote: from Imperium at 10:18 pm on July 31, 2006

http://www.golivewire.com/forums/topic.cgi?topic=322409&support=HTML&z=Tutorial

This might make the situation clearer for some people.

Imperium Posted at 12:18 pm on July 31, 2006
http://www.golivewire.com/forums/topic.cgi?topic=322409&support=HTML&z=Tutorial
All 12 previous replies displayed.