Transcript setB

Writing HTML specifications:
• A HTML specification for a WWW document
must be stored in a plain text file
• The text file must not contain any control
characters
• Thus, it is best to use a plain text editor to write a
HTML specification
• Save it in a file with either a .html or a .htm
suffix
• Where to store your HTML files –
– In your public_html directory
More on HTML
• Like every language, HTML can be used
correctly and incorrectly
• You will frequently see badly written
HTML specifications, because many web
pages are written by self-taught enthusiasts
• Web browsers try to avoid crashing when
they find badly-written pages
• But it is wrong to rely on this
Structure versus Rendering
(contd.)
• If you look at web pages written by other
people you will frequently rendering tags
used
• This is BAD practice
• I will try to avoid doing so
• If you read books on HTML you will find
rendering tags described
• Try to avoid using them
Consider the following:
Structure versus Rendering
•
•
•
•
Some words are in boldface large letters
How is this done?
Actually, we should not wonder HOW it is done
We should wonder WHY it is done
Structure versus Rendering
• Why was it done?
• Because the author wanted to have a heading for
the text that follows
Structure versus Rendering
• It just happens that Explorer (and Netscape too)
render headings in large bold-face lettering
• Other browsers might render headers differently
• EG, a speaking browser on a mobile phone might
render a heading by speaking it in a louder voice
Structure versus Rendering
• There are HTML tags to specify letter size
and to specify boldface but it is BAD
PRACTICE to use them
• I hope that you will never catch me using
them
• Or even introducing them to you
• If you find them in a book on HTML,
ignore them
Tagging for structure
• Okay, then, how do we tag headings?
• Surprise, surprise, there are special tags
• Indeed, there are several kinds of heading tags
because documents have several levels of
headings
Tagging for structure
• Okay, then, how do we tag headings?
• Surprise, surprise, there are special tags
• Indeed, there are several kinds of heading tags
because documents have several levels of
headings
Heading Tags come in pairs
• Top-level headings are enclosed by <h1>
and </h1> tags
• 2nd-level headings are enclosed by <h2>
and </h2> tags
• 3rd-level headings are enclosed by <h3>
and </h3> tags
• And so on ...
• Use lowercase tags
– The picture
on this
slide is
very old
– It shows
upper-case
tags, which
were
allowed
back then
– Upper-case
tags are not
allowed
any more
– Do not use
upper-case
tags