Tutorial: HTML Basics

15 posts Page 1 of 2
Contributors
User avatar
Toxikr3
Dedicated Member
Dedicated Member
Posts: 69
Joined: Tue Dec 08, 2009 12:49 am

Tutorial: HTML Basics
Toxikr3
An old tutorial I made, you can also refer to lewisfroom's tutorial over here:viewtopic.php?f=82&t=830
-------------------------------------------------------------------------------------------
Hi guys, I thought I'd write up a simple HTML tutorial just cause I was bored ^_^
It is not that long since there aren't any huge paragraphs to read, just some simple explanations.
If you find anything wrong please post ^_^

Index - Press CTRl + F - Type in the code to get to a topic
Name #
<html> - 1.0
<head> - 1.1
<title> - 1.2
Quick Review - 1.3
<body> - 1.4
Headers & paragraphs - 1.5
Emphasis - 1.6
Simple web page - 1.7
Image - 1.8

------------------------------------------------------------------------------------------------------

[1.0]

Ok, HTML stands for Hyper Text Markup Language. It is not a programming language but a markup language. It uses tags to create a webpage.

To keep it simple, you start a web page by using these tags:
Code: Select all
<html>
</html>
These tags tell the browser that this is an HTML document.
Everything after this will be nested inside these tags. Think of it as a container for all the good stuff ^_^
Almost all tags in HTML have a starting tag <> and a closing tag </>
There are exceptions, and I will talk about them later on.

[1.1]

The next tags I will talk about are the HEAD tags:
Code: Select all
<head>
</head>
[1.2]

If you are creating a simple website, most of the time you'd be only using these tags to put your TITLE in.
The TITLE tag:
Code: Select all
<title> </title>
Defines the title of a web page. Any thing between these tags will show up at the very top of the webpage. Eg. You have this site open, if you look at the very top you will see MMORPG Maker. That is the Title of this document.
When you get a bit more complicated, you might use the HEAD tag to put your CSS inside or your JavaScript inside, I won't be discussing them in this tutorial however.

[1.3]

To make sure you aren't lost, I'll review what I talked about.
You start a document by
Code: Select all
<html>
</html>
Inside these are the HEAD tags,
Code: Select all
<html>
    <head>
    </head>
</html>
Inside the HEAD tags are the TITLE tags
Code: Select all
<html>
    <head>
        <title> </title>
    </head>
</html>
It doesn't matter how you lineup your tags, the web browser will read it all the same. It is good to indent when nesting, its easier to read and understand. The same code above can be written like this
Code: Select all
<html><head><title> </title></head></html>
And the browser would show you the same thing. But now it looks bad, and harder to understand for us, so we nest them.

[1.4]

The next tag is the important tag.
Code: Select all
<body>
</body>
This tag holds pretty much all your text, images, paragraphs and what not.
This tag comes after the HEAD tag.
Code: Select all
<html>
    <head>
        <title> </title>
    </head>
    <body>
    </body>
</html>
So, that is how everything looks in its most basic layout. I like to write
<title> </title>
on one line because titles are usually that long. You can write however you like.

Ok, so we have learned the basic, no let's get some text on the screen?
These next tags go inside the BODY tag. Most of your tags will be inside the BODY tag.

[1.5]

Lets start from the top. When you write a report for school/work you first, write the heading, then you write your paragraphs, then you bold italics and underline your text, then you add some images to make it look pretty.
So, that is the order I will tell you about the tags.

To write a header on a web page, you use:
Code: Select all
<h1> </h1>
Now, there are variations of these tags. The H1 tag will write the biggest possible header, relatively speaking.
These are the tags for writing headers:
Code: Select all
<h1> </h1>
<h2> </h2>
<h3> </h3>
<h4> </h4>
<h5> </h5>
<h6> </h6>
In this, H1 is the biggest font size, and H6 is the smallest font size. Simple isn't it?

Now, heading is done, we will write our main text
Code: Select all
<p>
</p>
This tag is used to write paragraphs on a web page, thus the letter “p”
Not a lot to talk about this tag. Its simple, any text inside this would be written in a paragraph like structure.

[1.6]

Now, to emphasis your points in your paragraph you'd use bold,italics, and underline. To that using tags is quite simple.
Bold
Code: Select all
<b> </b>
Italics
Code: Select all
<i> </i>
Underline
Code: Select all
<u> </u>
Very simple. But to avoid bad habits in the future, try nesting them also.
Eg.
Code: Select all
<b>I am bold and <u>underlined</u></b>
This will print
I am bold and underlined

However this could also work
Code: Select all
<b>I am bold and <u>underlined</b></u>
See the difference? First one is the good way to write it.

[1.7]

Ok here are all the tags together to create a small web page. This is very simple.

Code: Select all
<html>
    <head>
        <title>My first webpage</title>
    </head>
    <body>
        <h1>Welcome</h1>
        <h3>Hope you enjoy your stay</h3>
        <p> This is my webpage, I don't really know what to <b>talk</b> about so I will <u><i>simply</i></u> write random stuff</p>
    </body>
</html>
[1.8]

Ok now that you have a header, paragraph and some emphasis, let's let to add images.
The tag to add images is:
Code: Select all
<img src=””>
See how there is no ending tag for this?

Inside the “” goes your location of the image and name. If your image is in the same directory as your page, you simply write the name of the image with the extension. Eg

Your page is in c:\MyFolder
And your image is also in the same place, the image is a “.gif”, and is called “picture”
So you write
Code: Select all
<img src=”picture.gif”>
If the image was in C:\ you'd write
Code: Select all
<img src=”\picture.gif”>
An important attribute of the “img” tag is “alt”
“alt” is the alternate text, if for some reason the image does not load, the text will be used in it's place.
To use it:
Code: Select all
<img src”” alt=””>
Simple enough ^_^

Try using the "img" tag with the basic layout.
Other attributes for the "img" tag:
Code: Select all
align - top
          bottom
          middle
          left
          right
eg.
<img src="" align="top">

width/height - Can be in pixels or percentage
eg.

<img src="" width="100%">
or
<img src="" width"100px">

NOTE: They are not the same.
Lewis
Coding God
Coding God
Posts: 1564
Joined: Sun Dec 20, 2009 2:12 pm

Re: Tutorial: HTML Basics
Lewis
Wonderfull tutorial ! Well explained, brilliant :D
Image
Lewis
Coding God
Coding God
Posts: 1564
Joined: Sun Dec 20, 2009 2:12 pm

Re: Tutorial: HTML Basics
Lewis
I love the way you have done the little navigate thingy, Nice :P
Image
User avatar
Toxikr3
Dedicated Member
Dedicated Member
Posts: 69
Joined: Tue Dec 08, 2009 12:49 am

Re: Tutorial: HTML Basics
Toxikr3
Thanks ^_^
Lewis
Coding God
Coding God
Posts: 1564
Joined: Sun Dec 20, 2009 2:12 pm

Re: Tutorial: HTML Basics
Lewis
:P
Image
User avatar
man123103
Just Registered
Just Registered
Posts: 5
Joined: Wed Apr 07, 2010 9:18 pm

Re: Tutorial: HTML Basics
man123103
Very helpful tutorial for beginners wanting to start learn html coding :)
User avatar
Livengood
Serious Programmer
Serious Programmer
Posts: 444
Joined: Tue Feb 16, 2010 6:24 am

Re: Tutorial: HTML Basics
Livengood
Very nice tutorial :D
Image
User avatar
zachman61
VIP - Donator
VIP - Donator
Posts: 1891
Joined: Wed Dec 16, 2009 9:56 pm

Re: Tutorial: HTML Basics
zachman61
not bad i knew all this but not bad :)
Nailing my feet to the floor is easier than using my own muscles to balance, but you don't see me doing that :)
GoodGuy17
Coding God
Coding God
Posts: 1610
Joined: Mon Sep 07, 2009 12:25 am

Re: Tutorial: HTML Basics
GoodGuy17
I made a text file to save with code like this, credits from this tutorial, and more. I made a Mini-Site with pure HTML, though it is basic and I am too embarassed to show it :P This is very VERY helpful.
User avatar
zachman61
VIP - Donator
VIP - Donator
Posts: 1891
Joined: Wed Dec 16, 2009 9:56 pm

Re: Tutorial: HTML Basics
zachman61
GoodGuy17 wrote:
I made a text file to save with code like this, credits from this tutorial, and more. I made a Mini-Site with pure HTML, though it is basic and I am too embarassed to show it :P This is very VERY helpful.
don't be embarrassed of progress here is a site i made
stickpiv.co.cc
the game page is screwed up so dont click it if you view it
Nailing my feet to the floor is easier than using my own muscles to balance, but you don't see me doing that :)
15 posts Page 1 of 2
Return to “Tutorials”