XHTML (Part 1)

Programming HOW TOs and in-depth guides for programmers of all levels. Programming is an essential skill for hackers, so start learning today!
Post Reply
Posts: 5
Joined: Mon Jan 29, 2007 3:37 pm

XHTML (Part 1)

Post by crud3w4re » Tue Jan 30, 2007 8:39 am

What does HTML stand for?

Hyper Text Markup Language.

An HTML document contains a bunch of HTML tags, but it can use other things, you can use javascript, you can even embed PHP, but that's for another time. It's basically orders to the browser of what you want it to show, that is basically what HTML is good for, it's pretty static.

What do I need to create HTML documents?

A text editor [Notepad will do], a computer, and a will. That's about it. Just remember, each HTML code has a purpose, you must understand each tag to know the meaning behind it. You need to memorize every HTML tag, and you will need to view pure HTML documents and know how to do it without looking at the souce, that's the only way you'll learn.

To tell you the truth, I'm not uber l33t at HTML, I have trouble remembering things, and I have to often look at the sourcecode to understand how something was done. That's why I'm writing this tutorial, writing tutorials helps you figure out what you know and what you don't know.

If you don't know where Notepad is, you should really get used to using a computer before you try to understand this tut. :) When you save notepad, save as whatever.html you can use ".htm" as well, but search engines prefer the ".html". So do it that way.

View the source of a website by rightclicking and "view source," this is the code. Not all sites are coded in pure HTML, so keep this in mine. HTML might be n00bish, might not be able to create custom scripts with it, but you can still utilize CSS to create awesome templates that people might want to pay $$$ for. I'm all for open source, but money is money. I hate corporations, that's why it's good to crack their programs, but it's ok to make money for yourself.

Anyway, let's move onto a basic HTML document, k?

<> -- In case you were wondering, these are "tags"

<html> -- Just let's the browser know that this will be an HTML document
<head> -- This is the header, sometime's you don't even include this. It's header information that isn't shown in the browser window.
<title> -- This will be the text of what's in the title bar, try it out, you'll see. Always close an HTML tag with a </> so, for example, <title> closes with </title> see? But, not all HTML tags require closing, depends, we'll get to that.
<body> -- This will be the body of the HTML document, that's like all the content you see on an HTML site basically.
</body> -- This is what you use when you're finished with the content of your page.
</html> -- Always close an HTML document with this, when you're finished.

That's basically:

<title>HTML is cool</html>
Ohh I such a n00b hehe

Type this into Notepad and save as "page.html" or anything.html doesn't matter what you name the page, just remember the ".html" part. Maybe it's better to create "index.html" just will get you into the habit of creating a HTML page.

Now we'll move onto HTML tags:

<b>Bold</b> See! This creates bold text[HTML might not be enabled in posting], good for emphasising things on a page, eh?

Remember <b></b> tags, and the like, should be WITHIN the <body></body> tags, not anywhere else!

Why do we use HTML in lower cases?

Because, XHTML demands that we do so, that's why. It's the internet standard, though, you can use caps, but why? It's always best to use lower case, your code will be ridiculed if you show people your HTML in all caps. ;) It's always good to make sure your HTML documents are verified perfect HTML, perfect XML, perfect whatever you're using to create the web document, why? Because it's like a badge of honor, "wow, I am doing it right ...without error ...sw33t!" That's why. You can do what you want, just saying.

You can read all about the nitty gritty details of how HTML was creates, and the like, from various online sources, it's a waste of time bringing unimportant stuff like that up. We just want to use it, why do we care where we it came from, eh? lol.

K ... You can also add attributes to various things in HTML, like maybe you want to create a table? A table is like a neat "box" that can contain things, you'll see when you begin to experiment. So a basic table is <table border="0"> the value is "0", that means it's a not a "strong" box, you can increase the value to "1" "2" "3" "4" and so on, you'll see the change. So it's like the tables BORDER err that lining around it is increased by THIS MUCH, get it? If you never understand something, just pm me.

Always quote it, that's important, why it's important? I don't know. Just use it.

K, this wraps up part 1 of my "lessons." I'm actually picking up and re-understanding what I know as I write, which is cool. I will continue part 2 ...soon.

I know that there's many HTML tuts on this site, I just didn't think another would hurt.



Posts: 1
Joined: Mon Feb 19, 2007 9:55 pm

Post by TeKn1qu3z » Mon Feb 19, 2007 9:58 pm

Why post 4 times instead of just updating 1 thread?

User avatar
Posts: 1080
Joined: Tue Oct 31, 2006 11:11 pm
Location: /usr/bin/perl

Post by Aiden » Mon Feb 19, 2007 10:10 pm

TeKn1qu3z wrote:Why post 4 times instead of just updating 1 thread?
So he can have 5 posts, instead of 2. :D

No, I think it was because some of them were long enough to were if he were to put them all in one thread, he thought he might of been doing something wrong or something.

Some people seem to not like leaving humongous messages. It's more polite with smaller messages.
XHTML Part 4 wrote:how are my tutz so far? I break them up to keep n00bs focused, digest each part.
Or, maybe he just thinks he's better than us all, because he knows HTML.
"When it takes forever to learn all the rules, no time is left for breaking them."

Posts: 2
Joined: Fri Aug 21, 2009 8:15 am

Re: XHTML (Part 1)

Post by perfectlyunique » Fri Aug 21, 2009 9:02 am

wow i understood it =)

Post Reply