How to...
When I started learning html I went on the internet and searched "html tutorial". So I read this site and that site and learned little by little. I still don't know everything about
html because I didn't take a class on html that teaches you most everything you need to learn. And that is where I had a problem. I would think of something I wanted to
implement in my webpage and look it up. If I found the solution on how to do it, I would use it in my webpage. Then I had a font problem. For some reason my font would
bold in a weird looking way and I had no idea. So I asked
about my problem in echoecho.com's
forum, and
they told me that my webpage was messy and that I should validate it. I didn't know what that meant but I went to the site I was
given.
HTML Validator
There in the menu you can select "HTML Validator" and validate your webpage. So I put in my webaddress and clicked "check". Then I got two errors at first. One said
"No Character Encoding Found! Falling back to UTF-8." and the other said "No DOCTYPE Found! Falling Back to HTML 4.01 Transitional". I had no idea what these
two things meant or what it was I needed to do. But thankfully the site explains it there. Note before I continue; I use plain old notepad to write my webpages so if you are
wondering about how to do this in your webpage making program, I don't know. All I can say is open your source in notepad and write it in yourself. Either that or maybe
your program will do it for you. But for those of you who write your coding in notepad, this is for you.
Doctype
So, what you do is, first before you write anything else in your html
coding, you declare your "doctype". There is a
list where you can see the
different doctype. There are many, but if you want to use the latest html, which is 4.01 from that webpage, there are three types: Strict, Transitional and Frameset.
Strict is what they want people to use and basically you can't set any kind of display attributes to your tag and have to use CSS instead. Transitional allows some html
attributes that are being phased out but you could still use them if you have to. This means that you don't have to use only CSS for the way your webpage should look.
And frameset is for webpages that use frames. Attribute is a way of providing more information about a given tag or how to display it; like "align=center" or "width=54".
Here are the three doctypes.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
So you need to pick one doctype that you want to declare your html as and write that as the very first line.
Character Encoding
Then you need to declare your character encoding. This is so your browser knows which characters it should use so your webpage is seen correctly. The W3C actually
perfers you to declare it in the web server configuration file or administration program. I am not sure I can do that for my webpage, or don't know how, so I use the other
option. That is to declare it inside my head tags. First you pick the correct encoding. The widely supported encoding is ISO-8859-1 for documents in Enlglish and other
Western European languages. Then you type the following inside your head tags with your character encoding at the end.
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;
charset=ISO-8859-1">
Read more about it
here.
That's it
Well, sort of. Now that you have the two declaration required, the validator will be able to validate your webpage. If you're like me, it will find dozens of errors the first time.
That was annoying and I didn't like it at first. I thought, "Who are they to say I can't use this here or there. It works fine in my page!" But in the end I decided it was ok.
It fixed the font problem I had once my coding was validated and no longer messy. I think
what it does is to make my webpage viewable to everyone with many different kinds of browsers. So it's a way of making sure your page will look right no matter who views it,
I think. So that's it. Good luck fixing those errors!