w7 8 HTML
w7 8 HTML
human-readable
easier to maintain (version control)
easier to exchange
easier to convert (to web page, to PDF, …)
Markup
content
eleemnts
structure
style
Markup Languages
“emphasis” is seman
tic
“italics” is stylistic
not WYSIWYG
for example, where will lines be wrapped?
of tag naem
Paragraph Exaple
hwitespace is insignificant
Coments
opening tag:
Attribute Exapte
invalid:
Self Closing aTgs
thema tic
break: line
break:
Self Closing aTg Example
Element Hierarchy
top level
element:
subeleemnts:
metadata of
document: body of
document:
Document eTmplate
document type
document language a ttribute
Indentation
title:
others: attributes of (self closing)
character set
author, copyright
keyowrds
Madata Exapie
<head >
<title>The Beatles</title>
<meta charset="utf-8"/>
</head >
Content Elements
<!DOCTYPE html>
<hmt l lang="en" >
<head >
<title>The Beatles</title>
m< eta charset="utf-8"/>
</ head >
< body >
<p>The Beatles are regarded as the most important and
influential band in the history of rock music.</p>
html
l he ad title
L
bo d
meta
tp
y
p
Ephasis
• ephasized: em
<p>In the mid 1960s, there were sa many British
groups in the US music charts that the
Americans called it the <em>British invasion</
em>.</p>
pbo
t
dy
p
Lem
Importance
important:
Character eRferences
howto represent ?
not to be confused with an opening
tag character reference:
Character eRference Examples
Character eRference
< <
> >
& &
“ "
Unicdoe eRferences
Character eRference
< #&60;
< #&x3c;
Ğ #&x011E;
€ #&x20ac;
Ջ #&x054b;
Non-breaking Space
to preserve format:
Lists
unordered list:
ordered list:
definition list:
every itemis a , and a descrip tion:
term:
6fini tio 1st Exaple
<dl >
<dt>John Lennon</ dt>
<dd>Lennon released several successful albums... </dd>
<dt>Paul McCartney</dt>
<dd>McCartney hada long lasting solo career ... </dd>
<dt>George Harr ison</dt>
<dd>Harr ison had moderate success...</dd >
<dt>Ringo Starr </dt>
<dd>Starr alsa released singles and albums... </dd >
</ dl >
Images
image:
sourec a ttribute:
sourec acn be a rela tive path or a ewb address
alternate text:
alawys provide one for acessibility
lege Exapie
<h2>History</h2>
<p>The band was formed in Liverpool, England ... </p>
<h2>Discography</ h2>
<p>The Beatles released 13 albums in the UK:< /p>
anhc or:
destination address attribute:
< p>
Although their popularity increased in the UK,
at first they were rejected by major record companies.
A well-known story is about Decca Records
turning them down, saying that "guitar groups
are on the way aut". Finally, in 1962,
they signed with <a hre f="http://www.emi.cam/">EMI</ a > .
</ p>
Images as iLnks
anhc or element
SectionAnchors
in-document links
attributes for speicfying target
SectirdlExat:e
top level:
eahc
row:
eahc
ecll:
Exapı
<table>
<tr>
<td>No</ td>
<td>Ti tle </td>
<td>Lead Voca ls</td>
<td>Durat ion</td>
</tr>
<tr>
<td>l</td>
<td>Sgt. Pepper's Lonely Hearts Club Band </td>
<td>McCartney</ td>
<td>2:02</td>
</tr>
</table>
Header woR
in header row:
instead of
<table>
<tr>
<th>No</ th>
<t h>Ti tle </t h>
<th>Lead Voca ls</th>
<th>Durat ion</th>
</tr>
<tr>
<td>l</td>
<td>Sgt. Pepper's Lonely Hearts Club Band </td>
<td>McCartney</ td>
<td>2:02</td>
</tr>
</table>
owRGroups
header:
data:
suma tion:
lirp Exal:e