Practical Work 1 CSS
Practical Work 1 CSS
Лабораторная работа № 1.
Selectors
Element selectors
Allows you to select all tags of the same name on an html page. For
example, to change the color of all <p> paragraphs from black to red:
p{
color:#CC0000;
}
Selector by class
If you need to make the first paragraph in one style and color, the second in
another, the third in a third, etc. In this case, you can use a class selector. The
class description begins with a dot, then the name is written, after which the style
itself is described, for example:
.new {
font-family: arial, verdana, sans-serif;
font-size: 12px; color:green;
}
Id selector
HTML snippet::
CSS snippet:
Group selector
p, h1{
color:#color;
}
This selector will allow you to display paragraphs and 1st level headings in one
color.
Task 1. Using the element selector, write down information about the group
(Name of specialty, field of study, faculty, group number, number of people) in
green. Write the group list in different colors, using selectors by class and by Id.
Font family
The font family of the text is specified using the font-family property.
The font-family property can contain multiple font names. If the browser
doesn't support the first font, it tries to use the next font, and so on.
Note: If a font name contains more than one word, it must be in quotation
marks, like font-family: 'Times New Roman'. More than one font family is
specified in a comma-separated list:
Text alignment
Task 2. Write down and format the text in accordance with its description.
This paragraph is written in Arial Black font and has a size of 20 pixels.
This paragraph is written in Courier New italic font, 24 pixels, and justified. Set the red
line. This is text padding. This is text padding. This is text padding. This is text padding.
This is text padding. This is text padding. This is text padding. This is text padding. This
is text padding. This is text padding.
This paragraph is written in italic Comic Sans MS font and has a size of 1.3em.
Div and span tags, containers for styling
<div> Container tag for sections of an HTML document. Used to group
block elements for formatting with styles.
The <div> and <span> tags have no default styling and are almost always
used with a class attribute to easily add your own styles.
These are “clean” elements that are great for visually grouping other
elements.
Task 3.
Антивещество
Ведется довольно много рассуждений на тему того, почему наблюдаемая часть Вселенной состоит
почти исключительно из вещества, и существуют ли другие места, заполненные, наоборот,
практически полностью антивеществом; но на сегодняшний день наблюдаемая асимметрия
вещества и антивещества во вселенной — одна из самых больших нерешенных задач физики (см.
Барионная асимметрия Вселенной). Предполагается, что столь сильная асимметрия возникла в
первые доли секунды после Большого Взрыва.
4. Convert all the title letters to uppercase and set the spacing between them to 2px. Add a
printed title effect using two non-blurred shadows: a gray one, the same color as the text, offset
2px to the bottom right, and a white one, offset the same but 1px.
7. Set the paragraph indentation for paragraphs equal to the font size multiplied by 3, and
increase each first letter of the paragraph to 20px.
8. Achieve uniform text output across the entire width in paragraphs.
Task 4.
Pseudo-classes
Task 5.
Select only links to resources external to my-site.ru (see the attribute selector in the
lecture) using color: <color>
Task 6.
Solve the problem using color: <color> и opacity: <value>
Task 7.
Highlight download links for zip files only (use the attribute selector to
determine the file type in the link), use pseudo elements to add an arrow
(::before, ::after, и т. п.)!.
Task 8.
Solve the problem using color: <color> и pseudo-elements (first-line,
first-letter)