English and Finnish a re examp le s of n atural languages, which people learn to com-
municate with oth er peop le . However, if you want to talk to computers, you have to
learn artificial langu ages so that computers unde rstand and obey you. It’s very similar.
The only dierence is that people won’t obey you if you lack ch arm, while comp uters
won’t obey you if youre not accurate. Accuracy is cru cial. Similar to both is that it
takes a certain amou nt of p ractice before you r interlocutor understands you. I won’t
lie to you o n this one.
Maria: I’m just starting to learn Spanish and I must use a sign language a lot. I
suppose yo u cannot use a sign language with a computer.
Professor: That’s true. In natural languages, people use context and even a sign
language to guess what others have to say even though what they say may not be
grammatica lly correct. Computers don’t do that, though, and that’s the dicult part
of programming. You have to be exact.
All right. Let’s start programming, shall we?
1.2 Introducing HTML
Professor: To be precise, HTML is not a programming language but it is a so-called
markup language. That’s w hat the acr onym HTML stands for : Hypertext Markup
Language. Markup is a modern approach for adding dierent annotations to a docu -
ment in such a way that these annotations are distinguishable from plain text. Markup
instructions tell the program that d isp la ys your text what actions to perform while the
instructions themselves are hidden from the p erson that views your text. For example,
if you want a certain part of you r text to appear as a paragraph, you simply mark up
this p art of the text using appropr ia te tags:
<p>But it’s my only line!</p>
Maria: It looks quite straightforward. Are those p ’s in the angle brackets like com-
mands?
Professor: You could say that. They are called tags and they instruct or command a
browser to make a paragraph ou t o f the text between them.
Mike: That’s like formatting, isn’t it?
Professor: In a way, yes. Tags are like commands in a word processor that allow
you to format paragraphs, h eadings, and so forth. However, they only specify what to
format, not how to do it.
The above code fragment is an example of an HTM L element—the basic building
block of an HTML document. An H TML document is composed exclusively of ele-
ments. Each element is further composed of a start tag and end tag, and everything in
between is the content:
2 Meeting 1. Content and Structure
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.235.176