LABORATORY 4 Theory
LABORATORY 4 Theory
HTML is intended for creation of the documents placed on Web servers, access to which to be made by means of Internet.
The HTML document may be looked through by means of the browser (for example, Internet Explorer, Mozilla FireFox,
Opera). The HTML document is a usual text file, which containing information, and commands - tags (Tag – a label, a sign),
which specify how the browser will display the document. HTML – a page can be created by means of the Notepad.
Example.
<html>
<head>
<title> Это простейшая страничка
</title>
</head>
<body>
Привет! Добро пожаловать на мою
страничку!!!
</body>
</html>
Save the file with name suffix .htm or .html. Open this saved file. For return to a page code, do the following: press the
View menu and there choose command – HTML code Viewing.
There are two types of tags: opening and closed.
For example, <html> - opening, </html> - closed
1. Basic Tags
Tag Description
<html> Defines an HTML document
Example.
<html>
<head>
<title> Пример </title>
<body bgcolor = yellow text = red> Фон желтый, а текст красный
</body>
</html>
Example.
<h1 align = center> Глава 1 </h1>.
2. Tags of formatting
Tag Description
<abbr> Defines an abbreviation
Example.
<font size =5>Привет!</font> Это моя домашняя страничка. < font size
=+2>(комментарии)</ font>
<font face ="Times New Roman, Arial, Courier New">Это моя домашняя
страничка.</font>
Color table
Color name Code Color name Code
Black # 000000 Maroon # 800000
Green # 008000 Navy # 000080
Silver # C0C0C0 Red # FF0000
Lime # 00FF00 Blue # 0000FF
Gray # 808080 Purple # 800080
Olive # 808000 Teal # 008080
White # FFFFFF Fuchsia # FF00FF
yellow # FFFF00 Aqua # 00FFFF
Example.
Текст <Font color = red> красного </Font> цвета
3. Special symbols and comments.
Example
© Издательство " Высшая школа "
© Издательство “Высшая школа”
TABLES IN HTML
The HTML table allows authors to arrange data -- text, preformatted text, images, links, forms, form fields, other
tables, etc. -- into rows and columns of cells. Each table may have an caption that provides a short description of t he table's
purpose. HTML tables are created using the <table> tag along with other tags that are nested inside it (such as the
<tr> and <td> tags).
Tag Description
<table> Defines a table
<th> Defines a header cell in a table
<tr> Defines a row in a table
<td> Defines a cell in a table
Example
<table>
<tr>
<th>Месяц</th>
<th>Экономия</th>
</tr>
<tr>
<td>Январь</td>
<td>1000 тг.</td>
</tr>
</table>
The <TABLE> tag has attributes:
Attribute Value Description
align left Specifies the alignment of a table according to surrounding text
center
right
top
middle
valign Vertical aligns the content in a table row
bottom
baseline
bgcolor rgb(x,x,x) Specifies the background color for a table
#xxxxxx
colorname
border 1 Specifies the table borders
""
cellpadding pixels Specifies the space between the cell wall and the cell content
cellspacing pixels Specifies the space between cells
width pixels Specifies the width of a table
%
Example
<table bgcolor =yellow width=80% border=2 bordercolor=green align =center
cellspacing=5 cellpadding=8>
<tr>
<th width =30%>Имя</th>
<th width =50%>Фамилия</th>
<th width =*>Очки</th>
</tr>
<tr valign=bottom>
<td>Ева</td>
<td>Джексон</td>
<td>94</td>
</tr>
<tr align=center bgcolor=red>
<td><font color=white>Джейн</font></td>
<td><font color=white>Янсон</font></td>
<td><font color=white>84</font></td>
</tr>
<tr>
<td colspan="2"><font color=blue>среднее значение</font></td>
<td><font color=blue>89</font></td>
</tr>
</table>
1. Create of lists
HTML can have Unordered Lists, Ordered Lists, or Description Lists. Any list created according to next scheme:
Ordered Lists:
1. Element of list 1 Unordered Lists: Description Lists:
2. Element of list 1 Element of list 1 Definition 1
3. Element of list 1 Element of list 1 Description of definition 1
Element of list 1 Definition 2
Description of definition 2
Definition 3
Description of definition 3
HTML List Tags
Tag Description
<ul> Defines an unordered list
<ol> Defines an ordered list
<li> Defines a list item
<dl> Defines a description list
<dt> Defines the term in a description list
<dd> Defines the description in a description list
You can use any tags into any lists. For example, you can highlight Definition 1 in bold, if you writing <B>Definition
1</B>.
2. Ordered Lists
An ordered list starts with the <ol> tag. Each list item starts with the <li> tag. The list items will be marked with numbers.
Example
<ol>
<li> Кофе
<li> Молоко
</ol>
Example
Numbers: Upper Case: Lower Case: Roman Upper Roman Lower
<ol type="1"> <ol type="A"> <ol type="a"> Case: Case:
<li>кофе <li>кофе <li>кофе <ol type="I"> <ol type="i">
<li>чай <li>чай <li>чай <li>кофе <li>кофе
<li>молоко <li>молоко <li>молоко <li>чай <li>чай
</ol> </ol> </ol> <li>молоко <li>молоко
</ol> </ol>
3. Unordered Lists
An unordered list starts with the <ul> tag. Each list item starts with the <li> tag. The list items will be marked with small
black circles.
Example
<ul>
<li>Кофе
<li>Чай
<li>молоко
</ul>
Example
Disc:
<ul type=disc>
<li>кофе
<li>чай
<li>молоко
</ul>
Circle:
<ul type=circle>
<li>кофе
<li>чай
<li>молоко
</ul>
Square:
<ul type=square>
<li>кофе
<li>чай
<li>молоко
</ul>
4. HTML Description Lists
A description list, is a list of terms, with a description of each term. The <dl> tag defines a description list. The
<dt> tag defines the term (name), and the <dd> tag defines the data (description).
Example
<dl>
<dt>Кофе</dt>
<dd>- черный горячий напиток</dd>
<dt>Молоко</dt>
<dd>- белый холодный напиток</dd>
</dl>
List items can contain new list, and other HTML elements, like images and links, etc.
The <IMG> tag defines an image in an Web-page. This tag has two required attributes: SRC and ALT. The <IMG>
tag creates a holding space for the referenced image. <IMG> tag has not a closing tag.
Examples
<img src=”hello.gif” alt=”Привет!!” height=50 width=50> - relative link on
image (the image has to be in folder with HTML-document);
The <A> tag defines a hyperlink, which is used to link from one page to another.
The most important attribute of the <A> element is the HREF parameter, which indicates the link's page.
By default, links will appear as follows in all browsers:
An unvisited link is underlined and blue
A visited link is underlined and purple
An active link is underlined and red
The <A> tag has attributes:
Examples
<A HREF="pictures.html">Здесь</A>
находятся мои фотографии.
2. <FRAME> tag
The <frame> tag defines one particular window (frame) within a <frameset>. The <frame> tag hasn’t closing
tag.
Each <frame> in a <frameset> can have different parameters: border, scrolling, the ability to resize, etc.
<a
href ="3.htm" target="2"> загрузить 3-й
документ во второй фрейм</a>
Document's hyperlink, which load the third file's content
into the frame with name «2».
1. The <EMBED> tag defines a container for an external application or interactive content (a plug-in).
The <EMBED> tag has attributes:
Examples
<embed src="Linkin Park - What
I`ve done-LQ.avi" autoplaying="true">
Examples
<bgsound src=" Metallica_Nothing_Else_Matters.mp3" loop=20>
3. An HTML marquee is a scrolling piece of text in your webpage. This is created by using HTML
<MARQUEES> tag
The < MARQUEES > tag has attributes:
Attribute Value Description
width % This specifies the width of the marquee.
height % This specifies the height of the marquee. This can be a value like 10 or 20% etc.
up,
direction down, This specifies the direction in which marquee should scroll.
left right
scroll,
behavior slide This specifies the type of scrolling of the marquee.
alternate
scrolldelay number This specifies how long to delay between each jump.
scrollamount number This specifies the speed of marquee text.
loop number This specifies how many times to loop.
bgcolor color This specifies background color in terms of color name or color hex value.
hspace % This specifies horizontal space around the marquee.
vspace % This specifies vertical space around the marquee.
Examples
<marquee bgcolor=yellow>размещение
рекламы</marquee>
« NAVIGATION MAPS »
The <MAP> tag is used to define a client-side image-map. An image-map is an image with clickable areas.
The required name attribute of the <MAP> element is associated with the <IMG>'s usemap attribute and
creates a relationship between the image and the map.
The <MAP> element contains several of <AREA> elements, that defines the clickable areas in the image map.
The <MAP> tag has attributes:
Value Description
Specifies the coordinates of the left, top, right, bottom corner of the rectangle (for
x1,y1,x2,y2
shape="rect")
x,y,radius Specifies the coordinates of the circle center and the radius (for shape="circle")
Specifies the coordinates of the edges of the polygon. If the first and last coordinate pairs are
x1,y1,x2,y2,..,xn,yn not the same, the browser will add the last coordinate pair to close the polygon (for
shape="poly")
Examples
Create navigation map with name ImageMap:
<MAP NAME="ImageMap">
<AREA HREF="Содержание.html" SHAPE="rect" COORDS="0,0,70,140" ALT="Левая половинка">
<AREA HREF="фильмы.html" SHAPE="poly" COORDS="71,0,80,95,140,130" ALT="Правый
многоугольник">
</MAP>
<BODY>
Attach the map to the image:
REFERENCES