Home | Old Issues | Examples |
Welcome to Nathsite's weekly 'Around the Web in Eighty Kilobytes', a 20-part free guide to building a website of your own, and using the web well.
To stop getting ATWI80KB's, send an empty email to atwi80kb@homepage.com with 'NO MORE THINGIES' as the subject. To look at examples and previous ATWI80KB's, go to http://atwi80kb.homepage.com
AROUND THE WEB IN EIGHTY KILOBYTES 1.7 - 1.8
ATWI80KB 4
April 28, 2000
1) Paragraphs
2) Lines
Example
1) 'CLEAN' CODE
Using too many tags at the same time *might* confuse the browser if the tags are used incorrectly, in the wrong order. It doesn't usually happen, but to avoid it is no problem. Let's say you want Bold and Italic text. Here's how you write the code: Do <b><i>not</i></b> leave the ice cream in the microwave.
The browser might get confused if you write the same thing this way: Do <b><i>not</b></i> leave the ice cream in the microwave.
Tags shouldn't overlap. In the first example, <b> opens first and closes last. That's the correct way to write code, not like in the second example where <b> both opens and closes first. This 'correct' code is called *Clean Code*. If you don't type clean code, your page will probably work, but is less reliable and is in a bit of a mess. There are a few other examples of not-clean code, for example, most browsers don't need the HTML and BODY closing tags, but code is cleaner if you write them.
2) SPECIAL CHARACTERS
Let's say you make a webpage explaining different HTML tags. You type:
The next tag is the <br> tag.
The browser will think it's a real line break and display:
The next tag is the
tag.
To prevent this sort of confusion, the WWW chaps made special characters for HTML. The common ones are:
TAG SYMBOL
< <
> >
& &
© ©
® ®
(non-breaking space)
" " (this one isn't usually needed.)
There are totally about a hundred absolutely useless special characters like '¢', '£', '¥' '°' etc. Special characters don't need to be used *every* time you want to type a '<', '>', '&' etc. - only when it'll confuse the browser. You'll be able to tell when it'll confuse the browser with practice.
EXAMPLE
<html>
<head>
<title>Beware of the Sausage Goat</title>
</head>
<body>
Next Week:<br>
I'll tell you about the <font> tag & a <b>really <i><u>cool</i></u> thing</b> -- how to choose <i>color</i>!
</body>
</html>
See you in a week!
Aniruddh Nath
Email questions to atwi80kb@homepage.com - I'll reply if I have time. I might write stuff from your email in later ATWI80KB's.
NOTE: I'm not responsible for any damage done to your computer because of this tutorial.