If you already know how to identify and edit HTML tags, and why they are used, you can skip this lesson.
Did you ever have the misfortune of working with one of the early word processors? When you used them, everything you typed was stored in a text file, just the way you typed it... well, not quite. You see, whenever you or the software deci ded to put in a carriage return, or tab, or change to bold type, or change the font type, the software automatically inserted some control text right where the change was made. You probably weren't aware of the extra text, because when the software went to read it, it learned what to do when and where, but it hid the control codes from you. Some word processors had a special "draft" or "reveal codes" mode, and if you ever used that mode, you know what I'm talking about. (I hope it doesn't bring back ba d memories).
One of the reasons those old word processors could do all those fancy things with just a text file, is that the software reserved certain characters as "escape" characters. They were called "escape" characters because they made the word processor softwar e "escape" from its reading operation, and perform a "control" function. That escape character could not be used for anything else, except for indicating to the software that a control operation was required. Let's say, for example, that % was that special character. Then, as you were typing along "The quick brown fox", and you wanted to emphasize "jumps", then you would have hit the special hotkey that made it go to bold text, typed "jumps", hit the same hotkey ag ain, and the typed the rest "over the lazy dog." What you would have seen on your printed paper (and maybe the screen) was:
The quick brown fox jumps over the lazy dog.But what was actually stored by the software was something like this:
The quick brown fox %bjumps%b over the lazy dog.When the word processor software goes to re-read that line for printing, or maybe even the next day from your saved-file, it is going to start reading at the beginning of the line, and read one character at a time, until it gets to %. This tells it that something special is going to happen right here. So it reads the next character "b", which (because it comes immediately after the special % character), gets interpre ted as a control code, in this case meaning "everything from now on is bolded". At which time, the software continues reading one character at a time, in order, until it encounters another escape character, or until it's at the end of the f ile.
All this is important to us, because the softheads at NCSA (who developed HTML for building web pages), decided to use that same philosophy when they created the specs for HTML. This way, no special hardware or software was required for transferring web page files from one computer to another over the Internet. The Internet, you see, required that file transfers would all be done in simple text. But besides this, the simple text file lends itself to being easily read, and easily stored, no matter what kind of computers are involved at either end of the exchange, or anywhere in-between.
HTML (or "HyperText Markup Language" - our web page file) is always stored and transferred in simple text files. Lucky for us, because that means you don't need a $300 piece of software to build web pages. A simple text edito r (like MS Dos' EDIT or Windows' NotePad) is all you need, and that comes with the computer.
Let's say somebody wants to see your web page. They initiate the HTML transfer process when they request your URL (web page address) or when they click on a "link" that points to your web page. That far-away receiving browser (Netscape, Mosaic, or Inter net Explorer, for example), begins the process by telling the remote computer at their ISP (Internet Service Provider) what HTML document they want to retreive from out there on the World Wide Web (Internet). Their ISP then contacts your ISP, and after a few minor pleasantries, your ISP transfers your web page (in the form of an HTML text file) to the browser who requested it. When it gets to the far-away computer, it's a text file, just about exactly like you built it in your HTML file (well, not quite... but close enough). It then becomes the job of that remote browser to read the file, starting at the beginning, text character by text character, in order, until it gets enough information to render it on the screen of the remote computer.
Just like in the old word processor, the receiving browser must interpret and remove control codes, in sequence, so it knows what to display when and where. The process is called "parsing" and fortunately for us, no effort is required of the operator at all. The browsers do this magnificently.
And now we come to HTML "tags"...
Again, just like the old word processor, the browser has to have special characters which can only be used as "escape" characters. In HTML parlance, they're called tags. [Actually, the word "tag" is common usage for the technical HTML term "element". Since we're not linguistically religious about HTML's terms, we're going to stick with the term "tag"]
The geniuses at NCSA decided that the < ("less-than") and > ("greater-than") characters would work just fine for HTML tags - they're hardly ever used in normal text doc uments, so they're quite suited as a "escape" sequence. Here's how they work:
When the browser is parsing the newly arrived web-page (HTML) file, if it encounters a < > with a valid control word between the < and the > ;, it takes that word to represent an instruction, like "start using bold print". Having recognized it as a valid tag, it throws it away (so it won't show up on the screen), but it remembers what it was instructed to do. There are dozens o f valid code words, and all will be embedded in the tag (between the escape characters); for example, <B> means "start using bold text", and </B> means "stop usin g bold text". Everything that isn't embedded between a < and a > becomes text, words, the nitty gritty of our communication.
You already know how to type text, so everything in this course is dedicated to teaching you how to use tags.