Files
freeCodeCamp/guide/russian/css/structure-of-css/index.md
2018-10-16 21:32:40 +05:30

49 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Structure of CSS
localeTitle: Структура CSS
---
## Структура CSS
Правило CSS следует этой базовой структуре:
```CSS
selector {
property: value;
property: value;
}
```
Все внутри фигурных скобок стилей все, что выбрано [селектором](https://guide.freecodecamp.org/css/selectors) . Внутри правил CSS есть набор пар [свойств](https://guide.freecodecamp.org/css/properties) / значений.
У вас могут быть разные селекторы, разделенные комами:
```CSS
selector1,
selector2 {
property: value;
}
```
Несколько CSS-правил можно поместить в один файл CSS - вот пример:
```CSS
h1 {
color: red;
}
div {
text-align: center;
color: blue;
}
img {
margin-left: 2px;
margin-top: 100px;
}
```
#### Дополнительная информация:
* [Синтаксис CSS по коду](https://codetheweb.blog/2017/11/11/css-syntax/)
* Подробнее о [CSS-селекторах](https://guide.freecodecamp.org/css/selectors)
* Подробнее о [свойствах CSS](https://guide.freecodecamp.org/css/properties)