Sythe.Org Forums     Register     FAQ     Members List     Calendar     Mark Forums Read    
 
Sythe.Org Forums  
   Runescape Gold

Sythe.org — A Virtual Goods Trading Hub

Make real cash! buying and selling in-game items.

We have a no-scam policy.

You can make thousands playing your favourite games here at Sythe.org.

Just sign up an account and follow the rules!


Take me to

Runescape Markets

Other Game Markets

Support Center

Register an Account

Close
SuF's HTML Basics Guide I
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 06-21-2008, 02:08 PM
Legend
Java Programmers Pirate
 
Join Date: Jan 2007
Posts: 10,942
<3 n4n0
Default SuF's HTML Basics Guide I

HTML Basics

Welcome to my second guide. This guide is about the basics of HTML. If you have never seen HTML before this is the guide for you.

What is HTML?

HTML or Hypertext Markup Language is the most often used way of relaying information across the World Wide Web. It uses a set of “Tags” to change how information is displayed.

What is a browser?

A browser is what finds and displays websites. The browser that you are using (IE, FF, Ect.) deciphers the HTML tags and your text to display your website as you want it. Each browser displays the tags slightly differently, so while making your own website you will want to look at in as many browsers as possible to make sure it looks nice and works well. Two of the largest and most popular browsers are Internet Explorer that comes with Windows Operating systems and Fire Fox a free browser which many find to be better than IE.

Before you begin making HTML documents you will need a simple text editor, such as Notepad. For all of our proposes I will say that that all HTML files need to be saved with a “.html” or “.htm” extension, which is not entirely true.

Now lets begin your first website. To begin copy and paste the following code into your editor.

Code:
<html>
<head>
<title>My first website</title>
</head>
<body>
My body!
</body>
</html>
If you open that with FF or IE you will see the great wonders of your first website. Pretty boring eh?

Anywhere you see a “<Word>”, it is an opening tag. “</Word>” is a closing tag. Tags do many things from changing font color to adding links and images. Some tags do not have a closing tag, so there is a special way to close them that is not required but suggested.

NOTE: Unlike what others say, none of those tags are required for your website to work. But you should put them anyway.

Let’s break down that file to see what it really does.

Code:
<html>
This tag declares the beginning of your HTML document. You must put its closing tag, “</html>”, on the last line of your file. Everything between the opening and closing tags is where everything else goes.

Code:
<head>
Between the opening and closing tags of this tag you put many things that are more advanced, and unnecessary so we will skip this.

Code:
<title>My first website</title>
This tag changes what the title bar says. The title bar is in the top left corner of your browser. Put what you it to say between the opening and closing tags.

Code:
</head>
End of the <head> area. Nothing special enough for a basic HTML guide.

Code:
<body>My body!</body>
Ah, your body. The main part of your webpage is displayed here. Anything you want the viewer to see besides the title bar should be between the opening and closing tags of the body.

Code:
</html>
Like I said before, this is required at the end of your file, to say that there is no more HTML within the file.

Note: There are cases that “</html>” will not be on the last line of your file.

Now that’s all good and dandy but it does not meet W3C, the HTML police’s recommendations for the correct way to “mark up” or use HTML. They came out with XHTML in 2000. It makes many tags and attributes of tags deprecated, which means that your should not use them. Instead you should use CSS (Cascading Style Sheets) which requires just a bit more work.

Here is the same example above but it meets the W3C XHTML Strict recommendation.

Code:
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
<head> 
<title>My first XHTML website! </title>	
</head>
<body>
<p>YAY!</p>
</body>
</html>
It seems more complicated but it really is not. It is just telling the browser what type of (X)HTML your file is using to help with the displaying of your information.

We have a new tag, <p>. This simply makes the text in a paragraph type form, and all text is required to be surrounded by some sort of tag besides just the <body> tag in the XHTML Strict recommendation.

Now let’s make your text red.

In the old way of doing things you would use:

Code:
<font color = "red">YAY</font>
Congratulations, you just used your second attribute, color. (The first one is xmlns in the head tag in previous example.)

Attributes in tags tell the tags what to do. The <font> tag has many attributes that change how text is displayed. Most are deprecated, which means you should use CSS. An example of XHTML Strict is below.

Code:
<p style = "color: red;">YAY</p>
This makes everything within the <p> tag have those attributes. Let’s say we wanted to make our text bigger, and green.

NOTE: Make sure that the quotes are not “Curly Quotes”. If you are using Word or a similar program it might automatically put them in, which makes it non XHTML Strict, so because of this try and stick with simple text editors like Notepad.

Code:
<p style = "color: green; font-size: 150%;">YAY</p>
That makes the text within the <p> tags 150% bigger than normal, and green.

Code:
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
<head> 
<title>My first XHTML website! </title>	
</head>
<body>
<p style = "color: green; font-size: 150%;">YAY</p>
<p style = "color: red; font-size: 75%;">YAY</p>
<p style = "color: yellow; font-size: 300%;">YAY</p>
</body>
</html>
If you look at that in a browser you will see many different colors. But notice how they are all on the same line even though they are on different lines in your .HTML document. White space (Spaces, tabs, enter) do not effect how HTML is displayed. To start a new line in HTML use:

Code:
<br />
This makes the text start on a new line. Use two to make a line in between things.

Note: This is the first tag that needs to close its self. It has not closing tag so you must put “ />” instead of just the normal “>”. This is only required for certain tags, which you will learn more about later. Just using “<br>” will work, but it does not meet W3C’s recommendation, again. Damned W3C!

Here is an example of use of <br /> tags.

Code:
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
<head> 
<title>My first XHTML website! </title>	
</head>
<body>
<p style = "color: green; font-size: 150%;">YAY</p><br />
<p style = "color: red; font-size: 75%;">YAY</p><br /><br />
<p style = "color: yellow; font-size: 300%;">YAY</p> <br /><br /> <br />
</body>
</html>
If you look at that in your browser you can see how the <br />s change it.

Now your website is pretty boring. Let’s give it some links to spice it up a bit!

Code:
<a href = "http://www.google.com">Text for link here</a>
That creates a link that says “Text for link here” which links to google.com.

Here is an example:

Code:
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
<head> 
<title>My first XHTML website! </title>	
</head>
<body>
<p><a href = "http://www.google.com">Text for link here</a></p>
</body>
</html>
Remember all of your text, links and such must be placed within tags such as <p>. You will learn more of these tags later on when you start working with div tags and other tags like it, but for now remember to use <p> around stuff.

Note: <p> makes the text like a paragraph so use it for each different paragraph.

Now, let’s make the link red. To do this we will be using the same style attribute as we did before.

Code:
 <a style ="color: red;" href="http://www.google.com">Text for link here</a>
It’s pretty simple right? The style attribute is very versatile working for almost everything. You could also change the size like you did above and many other things! Now, I know you are all dying to add pictures, so that is next.

Code:
 <img src="name of file" alt ="what text if pic not displayed" />
Now that was not so hard was it? The “alt” attribute is required for XHTML Strict recommendation. <img> is the second tag that requires the /> to close it since it does not have a closing tag. Remember to do that to follow W3’s recommendation.

Note: All tags should be in lower case to follow W3’s recommendation.

Here is a list of some other text formatting tags:

Code:
<b></b> - Makes text bold
<i></i> - Makes text italic
<big></big> - Makes text bigger than surrounding text
<small></small> - Makes text smaller than surrounding text
<sub></sub> - Subscript
<sup></sup> - Superscript
All of these need to be used in the <p> tag or within a <div> tag which is more advanced. For now just surround each paragraph of your text in a <p> tag.

If you want to format a heading outside of a <p> tag you should use one of these.

Code:
<h1></h1> - The largest heading format
<h2></h2> - smaller
<h3></h3> - smaller
<h4></h4> - smaller still
Remember do not use these within a <p> tag.

That is the conclusion of my HTML Basics Guide.

To check if your HTML is valid XHTML you can go to http://validator.w3.org/ to have it validated, which I used to validate the examples in this guide.

Please post any suggestions you have and if you are confused about a section I will put more detail into it if you ask. If there is wrong information also please feel free to tell me and I will change it.

I am going to start working on a more advanced (X)HTML guide sometime.
__________________
PM me with any issues.

I do not MM or trade anything.
Anyone claiming to be me in a trade or MM is an imposter.

Last edited by SuF : 12-22-2008 at 11:20 PM. Reason: Made a bit easier to read, fixxed a few errors.
Reply With Quote
  #2  
Old 06-23-2008, 04:49 AM
jdmj101's Avatar
Forum Addict
 
Join Date: May 2007
Posts: 379
Send a message via MSN to jdmj101
Default Re: SuF's HTML Basics Guide

This is a great basic HTML tutorial. Anyone who wants to learn how to write web pages in HTML should begin here.
__________________
Vouch Thread - Over $700 in trades
http://www.sythe.org/showthread.php?...95#post5758995

People I've gotten banned:
{X}Hello Hoty

Last edited by jdmj101 : 06-23-2008 at 04:49 AM.
Reply With Quote
  #3  
Old 06-23-2008, 06:48 AM
Guitar Playa
$5 USD Donor
 
Join Date: Jun 2008
Posts: 923
Send a message via AIM to david493 Send a message via MSN to david493 Send a message via Skype™ to david493
Default Re: SuF's HTML Basics Guide

Aw yes i remember this in computer class. Our fat foreign teacher barely understood how to work a "UBS drive" as she called it, and she tried to teach us this.

8/10
Reply With Quote
  #4  
Old 06-23-2008, 10:46 AM
venom's Avatar
Half psychotic sick Hypnotic
Ex-Moderator
 
Join Date: Sep 2007
Location: Australia
Posts: 2,494
Default Re: SuF's HTML Basics Guide

Well detailed guide, good for beginner's, I suggest adding a little bit of colour to grab the readers attention, other than that very well done.
__________________
No freedom til' we're equal, damn right I support it.
Reply With Quote
  #5  
Old 06-23-2008, 01:20 PM
Hero
BANNED
 
Join Date: Jan 2007
Location: Brisbane,Australia
Posts: 6,982
Default Re: SuF's HTML Basics Guide

Great guide for beginners, all the information needed. You should add some information about designs like borders etc.
Reply With Quote
  #6  
Old 06-23-2008, 03:06 PM
Legend
Java Programmers Pirate
 
Join Date: Jan 2007
Posts: 10,942
<3 n4n0
Default Re: SuF's HTML Basics Guide

Quote:
Originally Posted by macroman View Post
Great guide for beginners, all the information needed. You should add some information about designs like borders etc.
i gunna make a more advanced one, maybe when i get back from vacation. :/


I might add color, but i don't like formatting shit on forums :/
__________________
PM me with any issues.

I do not MM or trade anything.
Anyone claiming to be me in a trade or MM is an imposter.
Reply With Quote
  #7  
Old 06-23-2008, 03:18 PM
Jansen's Avatar
Retired Admin :'(
Ex-Moderator
 
Join Date: Apr 2005
Posts: 5,162
Send a message via MSN to Jansen
Default Re: SuF's HTML Basics Guide

Thankyou for not using deprecated tags

I would have stabbed you.
__________________
Heya.
email me if you're looking for me.

jansen [at] jansentolle [dot] com
Reply With Quote
  #8  
Old 06-23-2008, 03:26 PM
Legend
Java Programmers Pirate
 
Join Date: Jan 2007
Posts: 10,942
<3 n4n0
Default Re: SuF's HTML Basics Guide

Quote:
Originally Posted by Jansen View Post
Thankyou for not using deprecated tags

I would have stabbed you.
lol, when i saw you had posted in here i thought


"Fuck, its Jansen"

I am glad you didn't stab me... o.O
__________________
PM me with any issues.

I do not MM or trade anything.
Anyone claiming to be me in a trade or MM is an imposter.
Reply With Quote
  #9  
Old 12-19-2008, 02:23 PM
Legend
Java Programmers Pirate
 
Join Date: Jan 2007
Posts: 10,942
<3 n4n0
Default Re: SuF's HTML Basics Guide

This also was just removed from the archive and I was told I could bump it up.
Reply With Quote
  #10  
Old 12-19-2008, 04:37 PM
Rawr's Avatar
Beaner Tea
$100 USD Donor
 
Join Date: Jul 2008
Location: World 71.
Posts: 2,467
Default Re: SuF's HTML Basics Guide

I'm glad this was de-archived because I didn't quite understand the whole 'embedding code in a tag' thing, this guide is very good. 9/10
__________________
Reply With Quote
  #11  
Old 12-19-2008, 08:39 PM
Legend
Java Programmers Pirate
 
Join Date: Jan 2007
Posts: 10,942
<3 n4n0
Default Re: SuF's HTML Basics Guide

Yea, I really liked this guide. So much better than the other HTML guides people right. My 2nd one is archived still, mainly because I think its horrible. :P
Reply With Quote
  #12  
Old 12-20-2008, 07:37 PM
Rawr's Avatar
Beaner Tea
$100 USD Donor
 
Join Date: Jul 2008
Location: World 71.
Posts: 2,467
Default Re: SuF's HTML Basics Guide

If you know anything about classes, could you add some information about that? Because I still don't fully understand them.
__________________
Reply With Quote
  #13  
Old 12-21-2008, 01:21 AM
Legend
Java Programmers Pirate
 
Join Date: Jan 2007
Posts: 10,942
<3 n4n0
Default Re: SuF's HTML Basics Guide

Classes for css?
Reply With Quote
  #14  
Old 12-21-2008, 01:32 AM
Rawr's Avatar
Beaner Tea
$100 USD Donor
 
Join Date: Jul 2008
Location: World 71.
Posts: 2,467
Default Re: SuF's HTML Basics Guide

I know how to build them in CSS, but like adding them into tags like an IMG tag.
Ex: <img src="" class="" alt="">

Is this a limited thing? or can it be put in all tags.
__________________

Last edited by Rawr : 12-21-2008 at 01:51 AM.
Reply With Quote
  #15  
Old 12-21-2008, 01:48 AM
Legend
Java Programmers Pirate
 
Join Date: Jan 2007
Posts: 10,942
<3 n4n0
Default Re: SuF's HTML Basics Guide

I have only used it in divs to make things like large amounts of links. I have never used it in anything other than div, and for any other purpose besides layout and background color ect. What do you want to change about the image? That is basically all I know off hand, unless you specify.

PS. Put a god damned alt attribute on that tag before I shoot you. :P
Reply With Quote
  #16  
Old 12-21-2008, 01:54 AM
Rawr's Avatar
Beaner Tea
$100 USD Donor
 
Join Date: Jul 2008
Location: World 71.
Posts: 2,467
Default Re: SuF's HTML Basics Guide

Quote:
Originally Posted by SuF View Post
I have only used it in divs to make things like large amounts of links. I have never used it in anything other than div, and for any other purpose besides layout and background color ect. What do you want to change about the image? That is basically all I know off hand, unless you specify.

PS. Put a god damned alt attribute on that tag before I shoot you. :P
So you can do <div id="" class="">? Also, can you replace a div with a <span class=""> to do the same attributes? Sorry for being so picky, just trying to learn.

PS: Sorry about the alt, I forgot lol.
__________________
Reply With Quote
  #17  
Old 12-21-2008, 02:02 AM
Legend
Java Programmers Pirate
 
Join Date: Jan 2007
Posts: 10,942
<3 n4n0
Default Re: SuF's HTML Basics Guide

Shit, hit backspace and back went back, so I lost my reply. :/

If you use the same class they should look about the same. I use div, never used span, but the only minor difference is that many browsers add line breaks before and after a div, but thats not major.

Example:

If you write a class that changes font stuff, and background you can use it on most everything like <div>, <span>, <p>, <table>... The class will effect them all the same way.

If your laying out links with a class, I use div but I guess span would work.

I forgot links.. You can use class on links to change color and stuff too... (Pretty sure not 100%, because I do not use classes much, but from my understanding you can do that)
Reply With Quote
  #18  
Old 12-21-2008, 02:07 AM
Rawr's Avatar
Beaner Tea
$100 USD Donor
 
Join Date: Jul 2008
Location: World 71.
Posts: 2,467
Default Re: SuF's HTML Basics Guide

I think I'm starting to understand it now, thank you very much.
__________________

Last edited by Rawr : 12-21-2008 at 02:08 AM.
Reply With Quote
  #19  
Old 12-21-2008, 02:12 AM
Legend
Java Programmers Pirate
 
Join Date: Jan 2007
Posts: 10,942
<3 n4n0
Default Re: SuF's HTML Basics Guide

Quote:
Originally Posted by Rawr Im Phat View Post
I think I'm starting to understand it now, thank you very much.
Your welcome. I may have to write a basic CSS guide. I did not want to before since I do not know it that well, but simple things such as colors and fonts would be easy. Except to see that sometime soon. I am going to write my MLA guide first.
Reply With Quote
  #20  
Old 12-21-2008, 06:51 PM
croolyzz's Avatar
Member
 
Join Date: Dec 2008
Posts: 47
Send a message via Skype™ to croolyzz
Default Re: SuF's HTML Basics Guide

nice
Reply With Quote
Reply



Cheap RS Gold Store  Runescape Gold

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

All times are GMT +1. The time now is 10:58 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.6.1