Professional Documents
Culture Documents
Lecture 1
HTML
<html>
<head>
<title>Title of page</title>
</head>
<body>
This is my first homepage.
</body>
</html>
HEAD ELEMENT
EXAMPLE
<!DOCTYPE html>
<html lang=en>
<head>
<meta charset=UTF-8 />
<title>Title of page</title>
<link rel=stylesheet type=text/css href=main.css />
</head>
<body>
This is my first homepage.
<b>This text is bold</b>
</body>
</html>
TITLE ELEMENT
Example:
<head>
<title>Title of page</title>
</head>
LINK ELEMENT
</head>
STYLE ELEMENT
STYLE element is used to embed style sheet on a same web
page.
Example:
<head>
<title>Title of page</title>
<style>
p{
line-height: 1.2;
}
p.first:first-line {
font-variant: small-caps;
}
</style>
7
</head>
META TAG
EXAMPLE
<head>
<meta charset=UTF-8 />
<meta http-equiv=refresh content=5;
url=http://sites.google.com/site/cs1113webprog />
<title>Title of page</title>
<link rel=stylesheet type=text/css href=main.css />
</head>
It describes the character being used by this document. So
browser can display properly.
Second META tag will wait for 5 seconds and then redirect
9
to this course web page.
EXAMPLE
EXAMPLE
<title>
Bills Amazing New Page!
-*-*-*Amazing, New, Bill, Page, Web site,
C++ Tutorials, blah blah blah
</title>
So, SEO focus start abusing the title tag by putting the
same garbage in the title tag. Now search engine
algorithms of course ignore this too.
12
13
FONT ELEMENT
15
16
HIGHLIGHTING TEXT
EXAMPLE
Example:
<p>
The attackers set about acquiring the control over the
computers to be used in the attack.
<mark style=background-color: green; color: white;>
By scanning using Sscan SW,
</mark>
a large numbers of computers attached to the
Internet. Once a computer with a weak security
scheme is identified, the attackers try a break-in.
</p>
18
HEADING TAGS
19
Example:
<blockquote>
The attackers set about acquiring the control over the
computers to be used in the attack.
"By scanning using 'Sscan'
SW", a large numbers of computers attached to
the Internet. Once a computer with a weak security
scheme is identified, the attackers try a break-in.
</blockquote>
20
PRE-FORMATTED TEXT
PRE tag is used for pre-formatting text and it is useful to display text
in its natural format.
Example:
<pre>
This text is
preformatted
and should be
displayed in a
particular way
and shape without any
reformatting
by
the
browser.
21
</pre>
EXAMPLE
Example:
<pre>
int main (int argc, char ** argv ) {
printf("Hello World!\n");
return 0;
}
</pre>
22
EXAMPLE
Example:
<pre>
<html >
<head >
<meta charset="UTF-8" />
<title >
HTML preformatted Text
</title>
</head>
<body>
<h1> HTML Preformatted Text </h1>
</body >
</html >
</pre>
23