Professional Documents
Culture Documents
2
Introduction
HTML is the standard language for web pages.
These pages are located into particular directory on the web server that is
connected to the Internet, and thus become available on the Web.
The web browser reads these pages and presents the content to the user.
In addition to text, HTML allows you to view images, multimedia and links
(hyperlinks).
3
Introduction
As we said earlier, HTML is a language designed for the description text.
Besides him, there are a number of languages that allow to describe the
appearance and content of a text.
4
Introduction
In hypertext, the most significant are the following languages:
SGML,
HTML (HyperText Markup Language),
DHTML (Dynamic HTML)
XHTML (Expandable HTML) и
XML (Extensible Markup Language).
5
Introduction
HTML was created by simplification of SGML language, with the
purpose of describing the documents to be published on the
web, so we can freely say that this was his simplified version.
6
Introduction
HTML pages can be generated using a simple text editor
(Notepad).
7
TAGs
HTML is based on the tags.
Tag is an HTML command that tells the browser how and in what way to show the contents of
web documents.
Tags are "case insensitive", which means that it does not matter whether they write in small or in
capital letters.
They are written in square brackets "<" and ">", for example. <html>.
The first pair is the start tag, and the other end tag.
8
TAGs
There are three types of HTML tags, such as:
attributes of tags in form “<X A1=a A2=b ...> test </ X>” with
additional information about the layout of the text “test”.
9
TAGs
HTML tags can have attributes that define them further, which are
stated in the initial tag.
The most important HTML tags are HTML and </ html>.
<html> tells the browser that the file he began to load is the HTML
document, and </ html> marks the end of an HTML document.
10
Document structure
HTML documents consist of two parts: the part that describes
the document (header) and the part that represents the contents
of the document (the body).
11
Document structure
Minimum structure of an HTML document includes tags:
12
Document structure
The content of the document header is not displayed in the
browser window, but as we have said provides some
information about the site.
The content between the tags <body> and </ body> appears as
the content of a web document in a browser window.
13
Example No.1
<html>
<head>
<title>
title of the document
</title>
</head>
<body>
content of the document
</body>
</html>
14
Comments in the document
HTML language has the opportunity to comment on the code,
which is executed by tag:
15
Headers
The titles in the document are encoded according to the relative
depth of the digits 1 through 6.
16
Example No.2
<html>
<head>
<title>
Titles
</title>
</head>
<body>
<H1> Title (header) H1 </H1>
<H2> Title (header) H2 </H2>
<H3> Title (header) H3 </H3>
</body>
</html>
17
Paragraphs
Paragraph is marked by brackets <p> and </ p>.
This tag can have attribute “align” with the values center, left
and right, which defines the position of the text in the document
as centered, left and right.
18
Example No.3
<html>
<head>
<title>
Paragraphs
</title>
</head>
<body>
<p align="left"> Left </p>
<p align="center"> Center </p>
<p align="right"> Right </p>
</body>
</html>
19
Divisions
A similar to paragraph, divs is defined by tags <div> ... </ div>.
Using this tag can be an effective way to use the style that will
be discussed in next lectures of this course.
20
Example No.4
<html>
<head>
<title>
Divisions
</title>
</head>
<body>
<div align="left"> Left </div>
<div align="center"> Center </div>
<div align="right"> Right </div>
</body>
</html>
21
Lines
HTML lines are defined with tag <hr>.
22
Example No.5
<html>
<head>
<title>
HR
</title>
</head>
<body>
<div align="left"> Left </div>
<hr>
<div align="center"> Center </div>
<hr>
<div align="right"> Right </div>
</body>
</html>
23
Lines
In addition to the above attribute, <hr> tag may contain
attributes “align”, “size”, “width” and “color”, which define the
alignment of the line, line weight in pixels, the length of line and
color of the line, respectively.
24
Example No.6
<html>
<head>
<title>
HTML line with atributes
</title>
</head>
<body>
<hr noshade align="center" size="6" width="50%" color="#ff0000">
</body>
</html>
25
Special characters
Special characters, such as: ©, ™ and others are defined by first
specifying the character '&' followed by the code.
Б Б б б
š š Č Č
В В в в
Г Г г г ć ć Ć Ć
Д Д д д č č Đ Đ
Ж Ж ж ж
Ð Ð đ đ
З З з з
И И и и € € † †
К К к к
‰ ‰ ™ ™
Л Л л л
© © ­ ®
Љ Љ М M
м м Н Н µ μ ¼ ¼
н н Њ Њ
½ ½ ¾ ¾
П П п п
Р Р р р ß ß ƒ ƒ
О С с с • • @ @
Ћ Ћ ħ ћ
… … « «
У У у у
Ф Ф ф ф » » ÷ ÷
Ц Ц ц ц ø ø Ø Ø
Ч Ч ч ч
× × / /
Џ Џ Ш Ш
ш ш Ž Ž
Ÿ ž Š Š
26
Example No.7
<html>
<head>
<title>
Special characters
</title>
</head>
<body>
©
™
</body>
</html>
27
Special characters
Б Б б б
š š Č Č
В В в в
Г Г г г ć ć Ć Ć
Д Д д д č č Đ Đ
Ж Ж ж ж
З З з з
Ð Ð đ đ
И И и и € € † †
К К к к
‰ ‰ ™ ™
Л Л л л
Љ Љ М M © © ­ ®
м м Н Н
µ μ ¼ ¼
н н Њ Њ
П П п п ½ ½ ¾ ¾
Р Р р р ß ß ƒ ƒ
О С с с
Ћ Ћ ħ ћ
• • @ @
У У у у … … « «
Ф Ф ф ф
» » ÷ ÷
Ц Ц ц ц
Ч Ч ч ч ø ø Ø Ø
Џ Џ Ш Ш
× × / /
ш ш Ž Ž
Ÿ ž Š Š
28
Text formating
HTML has one standard for all sizes, whether it is text, image, or something
else, which is very useful.
This standard is called the default, and in it all sizes are defined.
If you do not explicitly specify the size of a text, its size will be 3, font will be
Times New Roman and color will be black.
Coding of part of the web document with all the desired properties consumes
a lot of time, so using the default standard is best solution.
Thus, under this standard text within a web document is aligned with the left
side, unless otherwise indicated.
29
Example No.8
<html>
<head>
<title>
Centered text
</title>
</head>
<body>
<center> Centered text</center>
</body>
</html>
30
Fonts
Fonts in web documents can be changed by using the tags
<font> </ font>.
Like other tags, this tag have optional attributes that can
describe more closely the text in the web document.
Some of these attributes are: face (for font selection), color (to
select the font color) and size (for font size selection).
31
Example No.9
<html>
<head>
<title>
Fonts
</title>
</head>
<body>
<font face="Comic Sans MS"> This text is in font "Comic Sans MS" . </font>
<font color="#ff0000"> This text is in red, </font>
<font size=„5"> and this have size of 5. </font>
</body>
</html>
32
Fonts
In a web document can be used several different fonts, as is
shown in Example No.9.
33
Fonts
It is good practice when using fonts that are rarely used in Web
documents, to indicate several of them, one after another,
separated by commas.
If a user on his computer does not have a font that is listed first
in the order, then the browser try to display text in a font that is
listed next and so on in order.
34
Example No.10
<html>
<head>
<title>
Fonts
</title>
</head>
<body>
<font face="Comic Sans MS,Arial,Courier"> Usings fonts <font/>
</body>
</html>
35
Font attributes
The following table provides an overview of the attributes that
can be used within the tags <font> </ font>.
Таг Опис
<b> Дефинише bold текст
<big> Дефинише big текст
<em> Дефинише emphasized текст
<i> Дефинише italic текст
<small> Дефинише small текст
<strong> Дефинише strong текст
<sub> Дефинише subscripted текст
<sup> Дефинише superscripted текст
<ins> Дефинише inserted текст
<del> Дефинише deleted текст
36
Line breaking
According to the standard default, the text is automatically broken at the end of the line.
If you want to have some text in a row, then we can use tags <nobr> and </ nobr>.
37
Example No.11
<html>
<head>
<title>
Without breaking
</title>
</head>
<body>
<nobr> here is the text that will not be broken at the end of the line </nobr>
</body>
</html>
38
Line breaking
As from the above example can be seen, in the bottom of the window there was a horizontal scroll bar, so the user must scroll it to see the full text.
Breaking text to a precise location can be achieved by using the tag <wbr>.
He will wrap line if the text before it is too long to fit on one line.
It also makes it possible to break a long word at the end of the line.
39
Example No.12
<html>
<head>
<title>
Breaking text
</title>
</head>
<body>
This text wil be broken <wbr> here, and it goes in new line.
</body>
</html>
40
New line
Most text editors for moving to a new line use ENTER key.
Applying the same principles for writing web documents will not produce the same effect.
41
Example No.13
<html>
<head>
<title>
New line
</title>
</head>
<body>
First line
<br>
Second line
</body>
</html>
42
Blank space
To insert a blank space when writing in a text editor, we use the SPACE for a single blank space and TAB if we want more spaces.
However, the application of the same principle when writing code for web documents will not give the same effect.
43
Example No.14
<html>
<head>
<title>
White space
</title>
</head>
<body>
This is text without white spaces which is followed
     by 4 white space
</body>
</html>
44
Colors in HTML
Elements of Web documents can be displayed across the color spectrum.
using a predefined color name in English (for example, red for red
color)
or by using the hexadecimal RGB values, in front of which must
necessarily stand symbol # (# FF0000).
Another way of defining the color, may be carried out using RGB
(255,0,0) codes.
45
Colors in HTML
The following table gives an example of using the second
method of defining color.
46
Colors in HTML
W3C (World Wide Web Consortium) defined the names of 16 colors
for HTML and CSS (it willl be discussed in the next lectures).
These colors are: aqua, black, blue, fuchsia, gray, green, lime,
maroon, navy, olive, purple, red, silver, teal, white, and yellow.
Background and text within the entire web document is defined by the
attribute “bgcolor” and “text”, respectively, within the tag <body>.
47
Example No.15
<html>
<head>
<title>
Background and text color
</title>
</head>
<body bgcolor="#ffff00" text="#ff0000">
Background color is yellow and text color is red.
</body>
</html>
48
Colors & codes
The following slides gives an overview of codes and colors.
51
Colors & codes
navajowhite FFDEAD
blanchedalmond FFEBCD
papayawhip FFEFD5
antiquewhite FAEBD7
beige F5F5DC
cornsilk FFF8DC
palegoldenrod EEE8AA
khaki F0E68C
yellow FFFF00
gold FFD700
darkgoldenrod B8860B
peru CD853F
goldenrod DAA520
tan D2B48C
burlywood DEB887
darkkhaki BDB76B
chartreuse 7FFF00
greenyellow ADFF2F
lawngreen 7CFC00
lime 00FF00
52
Colors & codes
springgreen 00FF7F
palegreen 98FB98
mediumspringgreen 00FA9A
limegreen 32CD32
mediumseagreen 3CB371
yellowgreen 9ACD32
aliceblue 9ACD32
mediumaquamarine 66CDAA
darkseagreen 8FBC8F
forestgreen 228B22
green 008000
seagreen 2E8B57
olive 808000
olivedrab 6B8E23
darkgreen 006400
darkslategray 2F4F4F
darkolivegreen 556B2F
53
Colors & codes
aquamarine 7FFFD4
aqua 00FFFF
cyan 00FFFF
paleturquoise AFEEEE
turquoise 40E0D0
mediumturquoise 48D1CC
darkturquoise 00CED1
lightseagreen 20B2AA
cadetblue 5F9EA0
teal 008080
darkcyan 008B8B
steelblue 4682B4
deepskyblue 00BFFF
lightskyblue 87CEFA
lightsteelblue B0C4DE
powderblue B0E0E6
skyblue 87CEEB
54
Colors & codes
cornflowerblue 6495ED
dodgerblue 1E90FF
mediumslateblue 7B68EE
slateblue 6A5ACD
royalblue 4169E1
blue 0000FF
mediumblue 0000CD
darkslateblue 483D8B
navy 000080
darkblue 00008B
midnightblue 191970
indigo 4B0082
blueviolet 8A2BE2
darkorchid 9932CC
darkviolet 9400D3
mediumpurple 9370DB
orchid DA70D6
mediumorchid BA55D3
fuchsia FF00FF
magenta FF00FF
hotpink FF69B4
violet EE82EE
thistle D8BFD8
plum DDA0DD
palevioletred DB7093
deeppink FF1493
mediumvioletred C71585
purple 800080
55
darkmagenta 8B008B