HTML
HTML
properties
background
element properties right Style
top
properties
edge
COLOR
Style
right
text
line
display
div
box font body must
VALUE width
padding
user
FLOAT
user
text
auto normal
element
Style COLOR
bottom
flow
height auto border COLOR
user
text
normal font text auto
text
HyperText
Markup Language
HTML&CSS
text
properties
VALUE
margin
text
auto
properties
box
normal
text
flow
user
COLOR COLOR
COLORdiv height
line FLOAT
font left display
background
edge
background background
attribute
Style div
properties
text
user user
div
text text
VALUE
COLOR
must
user
auto
FLOAT
width
font box
normal
element
bottom
font body
text
height left right border VALUE
text
user
COLOR
COLOR font
flow text
auto
text
auto
text
right
attribute left border text
Style right Style
top
top
left right
COLOR
COLOR
attribute
display
Style box
background
Style
top
COLOR
display
COLOR
line
normal
edge
margin
FLOAT
Contents
What is HTML. History of creation.....................................5
HTML Standards...................................................................7
Browser War...........................................................................9
HTML Standards (continued)............................................12
Basic HTML definitions......................................................14
Selecting the code editor....................................................17
Notepad++............................................................................17
Sublime Text.........................................................................19
Atom......................................................................................20
Brackets.................................................................................21
Using Brackets to create and edit files...............................22
Creating files in Brackets.....................................................23
Brackets Extensions.............................................................26
Themes for Brackets.............................................................28
A few words about creating HTML files............................30
2
Contents
3
Unit 1. Introduction. HTML Structure
Group selector......................................................................81
ID selector ............................................................................82
Class selector........................................................................83
CSS properties.....................................................................86
Color Assignment Options.................................................86
Font Properties.....................................................................93
Text Alignment...................................................................103
Units of measurement in CSS...........................................103
Homework Assignment....................................................107
4
What is HTML. History of creation
What is HTML.
History of creation
HTML (HyperText Markup Language) is currently
the standard for documents transmitted on the Internet.
HTML markup is interpreted by browsers in the form of for-
matted text and can be displayed on the screen of a computer
monitor, tablet or smartphone.
HTML is based on SGML (Standard Generalized Mark-
up Language), which appeared in 1986, and corresponds to
the international standard ISO 8879. This language was origi-
nally intended for text structural markup, but did not contain
a description of document appearance that could be created
using it.
SGML meant a description of the syntax for writing
the main elements of markup, and even then they were called
tags, it in itself was not a system for marking text and did not
have a list of structural elements of the language in order to
use them when creating a document.
Nevertheless, there was a need to create a hypertext lan-
guage, and it should have:
■■ a description of the elements and their application;
■■ a list of elements for a document that can be displayed by
special programs.
That is why in 1991 the European Organization for Nu-
clear Research (CERN) in Geneva, Switzerland, announced
the need to develop a mechanism that allows the transfer of
hypertext information through the Global Network. The em-
5
Unit 1. Introduction. HTML Structure
6
What is HTML. History of creation
7
Unit 1. Introduction. HTML Structure
8
What is HTML. History of creation
9
Unit 1. Introduction. HTML Structure
10
What is HTML. History of creation
11
Unit 1. Introduction. HTML Structure
12
What is HTML. History of creation
13
Unit 1. Introduction. HTML Structure
14
What is HTML. History of creation
15
Unit 1. Introduction. HTML Structure
16
Selecting the code editor
Selecting
the code editor
At the moment there are a lot of code editors for HTML/
CSS. Consider the most popular of them.
Notepad++
A free text editor that supports and highlights the syntax
of over 100 languages. Can open files in different encodings.
On the official site https://notepad-plus-plus.org/ you can
download the latest version of the program.
17
Unit 1. Introduction. HTML Structure
18
Selecting the code editor
Sublime Text
Perhaps the most popular text editor. Conditionally free.
Thus, you can download it without payment, but after a cer-
tain time it will offer you to buy a license. Official website
https://www.sublimetext.com/ currently offers the 3rd version
of the editor for download.
19
Unit 1. Introduction. HTML Structure
Atom
20
Selecting the code editor
Brackets
A free text editor that supports opening files only in UTF-
8 format — the most common at the moment in the web. It
is designed by Adobe System to work primarily with HTML,
CSS, JavaScript. But it also allows you to work with php-files
and has a number of extensions to create themes for Word-
press, for example. The official site http://brackets.io/ allows
you to download the latest version of the editor.
21
Unit 1. Introduction. HTML Structure
22
Selecting the code editor
23
Unit 1. Introduction. HTML Structure
24
Selecting the code editor
25
Unit 1. Introduction. HTML Structure
Brackets Extensions
Believe me, it’s very convenient to install several import-
ant extensions (add-ins) within a few minutes and use them
in further practice.
Plugins, or Brackets extensions, are installed by clicking on
the button in the form of the lego piece on the Brackets dark
gray panel or through the menu File -> Extension Manager.
26
Selecting the code editor
27
Unit 1. Introduction. HTML Structure
28
Selecting the code editor
29
Unit 1. Introduction. HTML Structure
A few words
about creating HTML files
As mentioned above, you need to create files with the ex-
tension .html or .htm to work with HTML.
In Brackets, you can create this file through File -> New
or by pressing CTRL+N and saving it in the desired folder
with the desired name and extension. I’ll also remind you
about the 2nd method — it’s right click on the dark gray area
on the left and selection of the New File option.
But for sure, you will want to create a file directly in
the folder that you will work with using Windows Explorer.
Here you can encounter one dirty trick.
The fact is that on Windows systems, since the 7th ver-
sion it is usually accepted to hide file extensions. Therefore,
the appearance of your folder will be something like this:
30
A few words about creating HTML files
31
Unit 1. Introduction. HTML Structure
32
A few words about creating HTML files
33
Unit 1. Introduction. HTML Structure
The structure
of the HTML file. DOCTYPE
Any html-file has a basic structure, which consists of html,
head and body tags. But it always begins with a document type
declaration — DOCTYPE.
We are considering the syntax of the latest HTML stan-
dard at the moment — this is HTML5. For it, the type of
document is very simple:
<!DOCTYPE html>
34
The structure of the HTML file. DOCTYPE
35
Unit 1. Introduction. HTML Structure
36
The structure of the HTML file. DOCTYPE
37
Unit 1. Introduction. HTML Structure
38
The structure of the HTML file. DOCTYPE
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>First HTML Document</title>
</head>
<body>
<!-- The main code will be placed here-->
</body>
</html>
The root tag is <html>. All other tags are embedded in it,
like nesting dolls. This tag is used to specify the lang attribute,
which is responsible for the language on which this html page
was created. In the example, lang=»en», because English is
the most popular language in the world, and the text between
the <title> tags is also in English.
If you are creating a page with Russian text, the value of
this attribute must be «ru»: <htmllang=»ru»>
Further in the document structure there is a <head> tag,
the contents of which are not displayed on the page. However,
this is an important tag that performs «service» functions.
First, it indicates the <title> of the document, which is dis-
played on the tab in the browser.
39
Unit 1. Introduction. HTML Structure
40
The structure of the HTML file. DOCTYPE
41
Unit 1. Introduction. HTML Structure
42
The structure of the HTML file. DOCTYPE
43
Unit 1. Introduction. HTML Structure
44
The structure of the HTML file. DOCTYPE
45
Unit 1. Introduction. HTML Structure
46
The structure of the HTML file. DOCTYPE
47
Unit 1. Introduction. HTML Structure
48
The structure of the HTML file. DOCTYPE
49
Unit 1. Introduction. HTML Structure
Paragraphs in HTML
As in printed publications, paragraphs are the basic
elements for formatting the text that makes up the article.
The <p> </p> tag is intended for the creation of paragraphs.
50
The structure of the HTML file. DOCTYPE
Example:
52
The structure of the HTML file. DOCTYPE
53
Unit 1. Introduction. HTML Structure
54
The structure of the HTML file. DOCTYPE
55
Unit 1. Introduction. HTML Structure
We get:
<p>
Lorem ipsum dolor sit amet, consectetur
adipisicing elit. Necessitatibus, possimus!
</p>
h1>lorem5
<h1>Lorem ipsum dolor sit amet.</h1>
h2>lorem3
<h2>Lorem ipsum dolor.</h2>
And so on…
մմ Note: Emmet plugin uses abbreviations — character
sequences, which allow you to display tags, attributes
and text in a certain sequence and with certain levels
of nesting.
More on abbreviations:
■■ http://webdesign-master.ru/blog/html-css/2.html
■■ http://html-plus.in.ua/formatirovanie-teksta-s-po-
moshhyu-emmet/
■■ http://ts-soft.ru/blog/emmet
■■ http://webtoks.ru/web/vvedeny-emmet/.
56
The structure of the HTML file. DOCTYPE
57
Unit 1. Introduction. HTML Structure
58
The structure of the HTML file. DOCTYPE
h1>lorem4^h2>lorem5^p*2>lorem15^h3>lorem4^p*3>lorem10
59
Unit 1. Introduction. HTML Structure
60
The structure of the HTML file. DOCTYPE
61
Unit 1. Introduction. HTML Structure
62
The structure of the HTML file. DOCTYPE
63
Unit 1. Introduction. HTML Structure
64
The structure of the HTML file. DOCTYPE
65
Unit 1. Introduction. HTML Structure
66
The structure of the HTML file. DOCTYPE
67
Unit 1. Introduction. HTML Structure
68
The structure of the HTML file. DOCTYPE
69
Unit 1. Introduction. HTML Structure
70
The structure of the HTML file. DOCTYPE
<br />
<hr />
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
71
Unit 1. Introduction. HTML Structure
HTML Rules
1. All spaces, tabulation and the beginning of new lines
are converted to a regular space. Therefore, it is very
desirable to format the text with indents:
<body>
<h1>Заголовок 1 уровня</h1>
<div id="test">
<p class="block">Lorem ipsum dolor sit amet,
consectetur adipisicing elit. Odio rerum,
praesentium repellat cupiditate dolorum
voluptatum. </p>
<br>
<hr>
72
HTML Rules
7. Universal attributes for all tags are: id, class, style, title,
tabindex
73
Unit 1. Introduction. HTML Structure
CSS Styles
Well, we got to the visual formatting of the page. From
the point of view of semantics, it is necessary to separate ‘the
wheat from the chaff ’, i.e. visual formatting of the site page
from its html-structure. And CSS just does formatting. And
it has a lot of properties for this in its arsenal.
You can add css-formatting in 4 ways:
1. Using the style attribute
2. Inside the <style> tags in the <head>
3. Using the <link> tag,
4. Using the @import directive.
In this lesson we’ll look at the first 2 ways. The rest — in
the next lessons.
Internal CSS styles (inline styles)
First, let’s look at how you can set the formatting for each
element. For this purpose, there is the style attribute, which
we have already discussed as one of the universal ones, i.e.
applicable for any tag.
For example, we need to change the color and style of
the text for a paragraph, and also assign a different font for
it. This is done as follows:
74
CSS Styles
75
Unit 1. Introduction. HTML Structure
76
CSS Styles
77
Unit 1. Introduction. HTML Structure
78
CSS Styles
79
Unit 1. Introduction. HTML Structure
Universal selector
A universal selector is used to assign rules to all elements
on the page, including html and body. It is indicated with
the asterisk (* — SHIFT + 8 key).
It is necessary in order to establish the same rules for all
elements of the page. For example, instead of setting the font-
size and font-family only for paragraphs, we set them imme-
diately for the entire page:
80
CSS Styles
Comments in CSS
Note that comments in CSS are different from comments
in HTML and are set using
/* … */
h1,h2,h3 {
font-family: 'Bookman Old Style', monospace;
line-height: 150%;
letter-spacing: 1px;
}
81
Unit 1. Introduction. HTML Structure
.cursive, .fantasy {
font-weight: bold;
letter-spacing: 2px;
font-size: 1.5rem;
}
ID selector
The id selector implies that the id attribute (a unique iden-
tifier) is specified for any one element on the page. The value
of this attribute in quotation marks cannot be repeated within
one page, otherwise no uniqueness will be obtained. The id
selector is denoted by the hash sign # next to the value of
the id attribute of the desired element. In the example below,
82
CSS Styles
#main-header {
background-color: #adf5ad;
}
#second-header {
background-color: #ffeb95;
}
83
Unit 1. Introduction. HTML Structure
84
CSS Styles
85
Unit 1. Introduction. HTML Structure
CSS properties
We have already examined some of the CSS properties
without being digging into their values. I think it was intui-
tively clear that the color property is responsible for the font
color, and font-size for the font size of the element.
Now let’s talk about the properties and their possible values
in more detail. At once I will make a reservation, that within
the limits of the first lesson we will consider the most necessary
ones. All the rest will be considered as we study the course.
Color Assignment Options
To set the color of different elements, you can use sever-
al rules. We will consider today the color property, which is
responsible for the color of the text, and background-color,
which controls the background color of the element.
And in both properties it is possible to set values in
the following formats:
86
CSS properties
87
Unit 1. Introduction. HTML Structure
see this, create style tags, and for the selector of any element,
for example for p, set the color property with any of the above
values. And then put the cursor inside the color value and
press CTRL + E. For fans of the right-click menu on the color
value, you can select «Quick Editing».
մմ Note: You can close the Quick Color Editing panel by
pressing CTRL + E again, pressing the ESC key or the cross
at the top left.
88
CSS properties
89
Unit 1. Introduction. HTML Structure
90
CSS properties
91
Unit 1. Introduction. HTML Structure
The values a fter the # sign are selected, so you can imme-
diately type in the ones you need or press CTRL+E to select
them.
Font Properties
In css, the properties for the font begin with the word
‘font’. There are several of them, and they perform the follow-
ing font changes on the page:
1. The font-family property points to the font family. In
the value of this property, you can list several fonts separat-
ed by commas in the order in which you (or the customer)
would like them to be displayed on the site. For example,
body { font-family: Lato, Verdana, Geneva, sans-serif; }
92
CSS properties
93
Unit 1. Introduction. HTML Structure
94
CSS properties
95
Unit 1. Introduction. HTML Structure
96
CSS properties
97
Unit 1. Introduction. HTML Structure
98
CSS properties
99
Unit 1. Introduction. HTML Structure
100
CSS properties
101
Unit 1. Introduction. HTML Structure
102
CSS properties
103
Unit 1. Introduction. HTML Structure
104
Homework Assignment
Homework Assignment
Today you will have a creative homework: you need to
write your autobiography or CV using the tags and css-prop-
erties that were discussed in this lesson.
Do not forget to break the text into headings and para-
graphs, highlight important things with <strong> or <em>
tags. You may use <hr> or <blockquote>, or <div> or <span>
tags with classes. And css-formatting.
As an example, I will give an autobiography of one of my
students. Humor and self-deprecation, as well as literacy +
style, are welcome.
Tatiana’s beautiful life: from birth to the present day
My childhood
I was born 38 years ago. My childhood was quite happy. I had
everything that the children of those times dreamed of. In
addition to kilograms of cakes and marshmallows, always avail-
able in the house, I had something more interesting. On my
eightieth birthday I got an electronic game «Mickey Mouse
catches eggs». And a block of chewing gum «Donald Duck».
Be sure, at that time I was the star of my street. Well, in any
case, I felt that way.
The ABCs of my life
As for the rest, my life was quite ordinary if not trivial: school,
technical college, university, marriage, birth of my son, realization
that somewhere I turned the wrong way, the divorce.
And, of course, my career. Being equipped with my diploma with
honors and trying to look for a job in my specialty «Accounting
and Audit», I got into a different industry altogether. I became
an appraiser. What can I say: the work was interesting, diverse,
not boring, be sure. Ten years of life was spent on inspection,
105
Unit 1. Introduction. HTML Structure
106
Homework Assignment
107
Unit 1.
Introduction to the Web-Technologies.
HTML Structure
© STEP IT Academy.
www.itstep.org
All rights to protected pictures, audio, and video belong to their authors or legal
owners.
Fragments of works are used exclusively in illustration purposes to the extent
justified by the purpose as part of an educational process and for educational
purposes in accordance with Article 1273 Sec. 4 of the Civil Code of the Russian
Federation and Articles 21 and 23 of the Law of Ukraine “On Copyright and Related
Rights”. The extent and method of cited works are in conformity with the standards,
do not conflict with a normal exploitation of the work, and do not prejudice the
legitimate interests of the authors and rightholders. Cited fragments of works can
be replaced with alternative, non-protected analogs, and as such correspond the
criteria of fair use.
All rights reserved. Any reproduction, in whole or in part, is prohibited. Agreement
of the use of works and their fragments is carried out with the authors and other
right owners. Materials from this document can be used only with resource link.
Liability for unauthorized copying and commercial use of materials is defined
according to the current legislation of Ukraine.