View Single Post
  #13  
Old 10-24-2008, 07:42 AM
Vodstok's Avatar
Vodstok Vodstok is offline
Fear scented candle
 
Join Date: Jan 2004
Location: The edge of forever
Posts: 13,650
Now for some notes:

If you are using one of the html editors I suggested, you may notice that rather than tags, you are getting gobbledygook. That is because some of them are too smart for their own good and capture the formatting from web pages when you copy and paste. To avoid this, copy and paste into notebook, then copy and paste that. Notebook is a “plain text” editor, so all formatting is stripped and only clean, pretty code is left.

I will also use this opportunity to share with you a little bit of “Best Practice”, basically the “right” or “Best” way to do things. As this is going to be XHTML rather than plain old HTML, there are some rules. Every tag must have a closing tag. So every <html> must have a </html>, every <head> must have a </head>, etc etc. There are “non enclosing” tags that seem to break this rule, but we will cover that later, and how they don’t really break the rule.

The last bit is this, pay attention to your nesting. Notice how the head and body are completely inside the <html> tags, and how the <title> tags are completely inside the <head>? This is very important. If you don’t, you end up with some batshit crazy looking page that will make you pull your hair out trying to figure out what the hell you did wrong. For a visual example:

GOOD:
<html>
<head>
<title>This is my kick-ass page title!!!</title>
</head>
<body>
My page has a hot body.
</body>
</html>



BAD:
<html><title>
<head>
This is my kick-ass page title!!!</title>
</head>
<body>
My page has a hot body.

</html></body>


Dropped on its head as a child, saves the day with the fat kid:
<title>
</ht
<heml> BA-BY RUTH!!!</title>
</head>
<bodad>
<hty>
HEY YOU GUYS!!!!
ml></body>
Reply With Quote