Have a look at this...
<body>
Something really cool
</body>
The browser won't recognize more than 1 space. I know at first this might all seem pretty stupid for it to be this way, but really, it's better like this. It gives you absolute control over the document's appearance.
There is a nifty little code that means "space" to the browser:
Try this instead...
<body> Something really cool </body>
The & means we are beginning a special character, the ; means ending a special character, and the letters in between are sort of an abbreviation for what it's for. There are quite a few of these special characters. Here are five more. (Note: these should always be lower case.)
non-breaking space < < less-than symbol > > greater-than symbol & & ampersand " " quotation mark
You don't need to use them all the time, just when typing the real character would confuse the browser. How do you know when that is? No hard and fast 'rule' that I can think of. It will just come with a little practice and a few screw-ups. I will say this... the only ones you're really going to need to remember are the non-breaking space (because it's the simplest way to add a few spaces) and less-than & greater-than <> (because a stray one of those in your web page can really cause you some grief).
By the way, some thoughts on mistakes & screw-ups. There are those that are of the opinion that mistakes are bad. They are afraid to try anything new for fear of messing it up. Making the same mistake over and over might be a little dumb, but especially while you are learning, don't be afraid to screw everything all up. Mistakes are our friends :-) If you are not screwing something up then you are not learning anything and probably not doing anything. Remember, messing things up is a perfectly acceptable part of learning!
OK, enough babbling. There are other special characters too. You won't use them very often, but when you do need one, it's good thing to know.
Let's go over the last couple points real quick because if you're at all like me, it will get confusing. The browser will dispay your text in a steady stream unless you tell it otherwise with line breaks, etc. It will reduce any empty areas to 1 space. If you want more spaces, you must use the space code ( ). Here's a tidbit that we didn't cover... If you hit Return (or Enter) while you are typing, most browsers will interpret that as a space... unless there is already a space there.
One more quick example...
<body> Something<br>really<br>cool<br>like<br>an<br>icecube! </body>
Pretty clear?? I hope so. I gave it my best shot!
So, you want to make a Web Page! |
Lessons: Intro 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
Index & Quick Reference Table of Contents ColorPicker BareBones HTML Guide |
Color Charts Simple Font Widget Practice Exercises Where are my images? |
Print version of this tutorial available - Get the PageTutor Book & CD |
Tutorial reposted with permission, courtesy PageTutor.com |