Alright kids, let's have some fun with xHTML and CSS Designing, this will be a series that will eventually teach you all how to make a full blown site.
Part 1 - The basic Markup and Tags
Contrary to what everyone else has been posting, I will show you the proper way to markup your xHTML document:
Now let's examine what we have here...
This tells the browser what version of (x)HTML we are using, this is important so that it will render 'properly' for that version and this way you are less likely to need to rely on that browser's error checking.
Beginning of the xHTML document.
This is the beggining of the HEADER, this is to contain purely information, there is to be NOTHING in here for the end user, it is purely for browsers/bots to view, Document title, stylesheet linking, meta tags, etc. go in this area.
This sets the default language for this document to unicode 8.
This is where you'd put your document title, it goes inside the tag, so you'd replace "Untitled Document" with something like "TDD is a fucking god".
This closes the header, it is VITAL to close ALL open tags, there are exceptions to this rule though, when it comes to self-closing tags, but we'll get to that later.
this is where all the information that gets shown to the user is placed.
This is the end of the HTML document, there should be nothing after this closing tag.
now that we've got a little explanation about what each of these does, let me tell you other HTML Tags that will aid you in this course (I won't explain them all, just the ones you'll more than likely use):
(There will be people who will probably try to argue that i have left out styling attributes in this, but that is for good reason, you DO NOT style the page in the HTML document, you do that in a seperate CSS file that I will explain in the next part)
Heading #1 - this is the most important heading in the document, do not confuse this with the header though.
Second most important heading.
(these tags go down to <h6>)
This is to format the text inside this tag as bold, it has since been deprecated for
so we will be using <strong>
Used to make text italic, again, it's better to use
(emphasis) so we'll use that.
Anchor(link) tag, this is used to define a link on the webpage to the location (href) you choose, by putting the destination inside the "" in href="", target is for telling the browser to do things like open in a new window (target="_blank") etc, you can also use it to link to a specific part of the document through IDs, but i'll explain this later.
Paragraph tag, this is what your body text should be inside, it sorts the content into paragraphs... logical amirite?
Break tag, this tells the browser to now go to the next 'line' in the document. This is also our first SELF CLOSING tag.
If the tag isn't self explanitory enough, it's used for quotes and shit.
Unordered List, this is probably the second most valuable tool in the web design arsenal when it comes to CSS Design, it can be used for virtually anything.
Ordered List (numbered).
This is used INSIDE the <ul> and <ol> tag, as it is a LIST ITEM (li), this tells the browser everything inside it is grouped.
definition list... very tiny chance you'll use it.
This is the most valuable design tool for CSS Design, it is an entirely empty tag, perfect for styling for any job.
This is our second SELF-CLOSING tag, see how the end is "/>" instead of ">" this closes itself. src="" tells the browser where the source(src) of the image file is relative to the HTML file, the alternate(alt) text for read-aloud browsers is kept inside alt="", this is a web standard and a requirement in ALL xHTML documents, you MUST include an ALTernate description.
I'd mention forms, but we won't go into that in the near future, they are tricky bastards.
What NOT to use:
use this tag for ANYTHING other than non-tabular data and you are not worthy of the internet (yes Cruel__Machine, that means you!).
Frames are useless faggotry, do not use them, there is no need to, they simply cause pain for the end user that is uneeded. same goes for <iFrame></iFrame>
Well, there's our first installment of TDD's web design tutorial, tune in next time for some more info on how to do shit right.
Ps: I should probably also mention that in xHTML you always use lowercase tags, not uppercase.
Part 1 - The basic Markup and Tags
Contrary to what everyone else has been posting, I will show you the proper way to markup your xHTML document:
HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
</body>
</html>
Now let's examine what we have here...
HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
HTML:
<html xmlns="http://www.w3.org/1999/xhtml">
HTML:
<head>
HTML:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
HTML:
<title>Untitled Document</title>
HTML:
</head>
HTML:
<body>
</body>
HTML:
</html>
now that we've got a little explanation about what each of these does, let me tell you other HTML Tags that will aid you in this course (I won't explain them all, just the ones you'll more than likely use):
(There will be people who will probably try to argue that i have left out styling attributes in this, but that is for good reason, you DO NOT style the page in the HTML document, you do that in a seperate CSS file that I will explain in the next part)
HTML:
<h1></h1>
HTML:
<h2></h2>
(these tags go down to <h6>)
HTML:
<b></b>
HTML:
<strong></strong>
HTML:
<i></i>
HTML:
<em></em>
HTML:
<a href="" target=""></a>
HTML:
<p></p>
HTML:
<br />
HTML:
<blockquote></blockquote>
HTML:
<ul></ul>
HTML:
<ol></ol>
HTML:
<li></li>
HTML:
<dl></dl>
HTML:
<div></div>
HTML:
<img src="" alt="" />
I'd mention forms, but we won't go into that in the near future, they are tricky bastards.
What NOT to use:
HTML:
<table></table>
HTML:
<frame></frame>
Well, there's our first installment of TDD's web design tutorial, tune in next time for some more info on how to do shit right.
Ps: I should probably also mention that in xHTML you always use lowercase tags, not uppercase.




