From 95aca4b4d8fa62815d4bd412fff1a364f842814a Mon Sep 17 00:00:00 2001 From: Ryan Johnson Date: Thu, 29 Apr 2021 16:16:42 -0700 Subject: remove retired locales (#699) --- files/uk/web/css/-moz-orient/index.html | 153 --- .../uk/web/css/@font-face/font-display/index.html | 87 -- files/uk/web/css/@font-face/index.html | 197 ---- files/uk/web/css/@page/bleed/index.html | 83 -- files/uk/web/css/@page/index.html | 112 -- files/uk/web/css/_colon_active/index.html | 129 --- files/uk/web/css/_colon_root/index.html | 100 -- files/uk/web/css/_doublecolon_before/index.html | 237 ---- files/uk/web/css/_doublecolon_slotted/index.html | 104 -- .../uk/web/css/alternative_style_sheets/index.html | 81 -- files/uk/web/css/animation-name/index.html | 141 --- files/uk/web/css/attr()/index.html | 265 ----- files/uk/web/css/backdrop-filter/index.html | 136 --- files/uk/web/css/css_animations/index.html | 140 --- .../css_animations/using_css_animations/index.html | 358 ------ files/uk/web/css/css_box_model/index.html | 162 --- .../mastering_margin_collapsing/index.html | 91 -- .../basic_concepts_of_flexbox/index.html | 392 ------- .../uk/web/css/css_flexible_box_layout/index.html | 132 --- .../basic_concepts_of_grid_layout/index.html | 699 ------------ files/uk/web/css/css_grid_layout/index.html | 245 ---- .../relationship_of_grid_layout/index.html | 628 ----------- files/uk/web/css/css_selectors/index.html | 116 -- files/uk/web/css/filter/index.html | 1184 -------------------- files/uk/web/css/flex-grow/index.html | 194 ---- files/uk/web/css/flex/index.html | 209 ---- files/uk/web/css/font-smooth/index.html | 85 -- files/uk/web/css/font-weight/index.html | 271 ----- files/uk/web/css/grid-template-areas/index.html | 181 --- files/uk/web/css/index.html | 92 -- files/uk/web/css/layout_cookbook/index.html | 81 -- files/uk/web/css/layout_mode/index.html | 31 - files/uk/web/css/linear-gradient()/index.html | 208 ---- files/uk/web/css/mozilla_extensions/index.html | 680 ----------- files/uk/web/css/order/index.html | 170 --- files/uk/web/css/position/index.html | 461 -------- files/uk/web/css/reference/index.html | 189 ---- files/uk/web/css/resize/index.html | 212 ---- .../uk/web/css/visual_formatting_model/index.html | 226 ---- files/uk/web/css/z-index/index.html | 134 --- 40 files changed, 9396 deletions(-) delete mode 100644 files/uk/web/css/-moz-orient/index.html delete mode 100644 files/uk/web/css/@font-face/font-display/index.html delete mode 100644 files/uk/web/css/@font-face/index.html delete mode 100644 files/uk/web/css/@page/bleed/index.html delete mode 100644 files/uk/web/css/@page/index.html delete mode 100644 files/uk/web/css/_colon_active/index.html delete mode 100644 files/uk/web/css/_colon_root/index.html delete mode 100644 files/uk/web/css/_doublecolon_before/index.html delete mode 100644 files/uk/web/css/_doublecolon_slotted/index.html delete mode 100644 files/uk/web/css/alternative_style_sheets/index.html delete mode 100644 files/uk/web/css/animation-name/index.html delete mode 100644 files/uk/web/css/attr()/index.html delete mode 100644 files/uk/web/css/backdrop-filter/index.html delete mode 100644 files/uk/web/css/css_animations/index.html delete mode 100644 files/uk/web/css/css_animations/using_css_animations/index.html delete mode 100644 files/uk/web/css/css_box_model/index.html delete mode 100644 files/uk/web/css/css_box_model/mastering_margin_collapsing/index.html delete mode 100644 files/uk/web/css/css_flexible_box_layout/basic_concepts_of_flexbox/index.html delete mode 100644 files/uk/web/css/css_flexible_box_layout/index.html delete mode 100644 files/uk/web/css/css_grid_layout/basic_concepts_of_grid_layout/index.html delete mode 100644 files/uk/web/css/css_grid_layout/index.html delete mode 100644 files/uk/web/css/css_grid_layout/relationship_of_grid_layout/index.html delete mode 100644 files/uk/web/css/css_selectors/index.html delete mode 100644 files/uk/web/css/filter/index.html delete mode 100644 files/uk/web/css/flex-grow/index.html delete mode 100644 files/uk/web/css/flex/index.html delete mode 100644 files/uk/web/css/font-smooth/index.html delete mode 100644 files/uk/web/css/font-weight/index.html delete mode 100644 files/uk/web/css/grid-template-areas/index.html delete mode 100644 files/uk/web/css/index.html delete mode 100644 files/uk/web/css/layout_cookbook/index.html delete mode 100644 files/uk/web/css/layout_mode/index.html delete mode 100644 files/uk/web/css/linear-gradient()/index.html delete mode 100644 files/uk/web/css/mozilla_extensions/index.html delete mode 100644 files/uk/web/css/order/index.html delete mode 100644 files/uk/web/css/position/index.html delete mode 100644 files/uk/web/css/reference/index.html delete mode 100644 files/uk/web/css/resize/index.html delete mode 100644 files/uk/web/css/visual_formatting_model/index.html delete mode 100644 files/uk/web/css/z-index/index.html (limited to 'files/uk/web/css') diff --git a/files/uk/web/css/-moz-orient/index.html b/files/uk/web/css/-moz-orient/index.html deleted file mode 100644 index 851b26e69b..0000000000 --- a/files/uk/web/css/-moz-orient/index.html +++ /dev/null @@ -1,153 +0,0 @@ ---- -title: '-moz-orient' -slug: Web/CSS/-moz-orient -translation_of: Web/CSS/-moz-orient ---- -
{{CSSRef}}{{Non-standard_header}}
- -

-moz-orient CSS властивість, що задає орієнтацію обраного елемента.

- -

{{cssinfo}}

- -

Синтаксис

- -{{csssyntax}} - -

Значення

- -
-
inline
-
The element is rendered in the same direction as the axis of the text: horizontally for horizontal writing modes, vertically for vertical writing modes.
-
block
-
The element is rendered orthogonally to the axis of the text: vertically for horizontal writing modes, horizontal for vertical writing modes.
-
horizontal
-
The element is rendered horizontally.
-
vertical
-
The element is rendered vertically.
-
- -

Приклади

- -

HTML

- -
<p>
-  The following progress meter
-  is horizontal (the default):
-</p>
-<progress max="100" value="75"></progress>
-
-<p>
- The following progress meter
- is vertical:
-</p>
-<progress class="vert" max="100" value="75"></progress>
- -

CSS

- -
.vert {
-  -moz-orient: vertical;
-  width: 16px;
-  height: 150px;
-}
- -

Результат

- -

{{EmbedLiveSample("Examples","200","360")}}

- -

Специфікації

- -

Though submitted to the W3C, with positive initial feedback, this property is not yet part of any specification; currently, this is a Mozilla-specific extension (that is, -moz-orient).

- -

Браузерна сумісність

- -

{{CompatibilityTable}}

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatNo}}{{CompatGeckoDesktop("6.0")}}{{property_prefix("-moz")}}[1]{{CompatNo}}{{CompatNo}}{{CompatNo}}
auto value{{CompatNo}}{{CompatGeckoDesktop("21.0")}}[2]
- {{CompatNo}}{{CompatGeckoDesktop(40)}}
{{CompatNo}}{{CompatNo}}{{CompatNo}}
inline and block values{{CompatNo}}{{CompatGeckoDesktop(40)}}{{CompatNo}}{{CompatNo}}{{CompatNo}}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatNo}}{{CompatGeckoMobile("6.0")}}{{property_prefix("-moz")}}[1]{{CompatNo}}{{CompatNo}}{{CompatNo}}
auto value{{CompatNo}}{{CompatGeckoMobile("21.0")}}[2]
- {{CompatNo}}{{CompatGeckoDesktop(40)}}
{{CompatNo}}{{CompatNo}}{{CompatNo}}
inline and block values{{CompatNo}}{{CompatGeckoMobile(40)}}{{CompatNo}}{{CompatNo}}{{CompatNo}}
-
- -

[1] In Gecko 6.0 {{geckoRelease("6.0")}}, there was a bug that causes vertical {{HTMLElement("progress")}} elements to render with the dimensions of a horizontal bar. This is fixed in Gecko 7.0 {{geckoRelease("7.0")}}.

- -

[2] The auto value was equivalent to horizontal.

- -

Дивитися також

- - diff --git a/files/uk/web/css/@font-face/font-display/index.html b/files/uk/web/css/@font-face/font-display/index.html deleted file mode 100644 index 736f517126..0000000000 --- a/files/uk/web/css/@font-face/font-display/index.html +++ /dev/null @@ -1,87 +0,0 @@ ---- -title: font-display -slug: Web/CSS/@font-face/font-display -translation_of: Web/CSS/@font-face/font-display ---- -
{{CSSRef}}
- -

Властивість font-display визначає як font face відображаєтся стосовно як він завантижився і готовий до використання.

- -

Хронологія відображення шрифта

- -

Хронологія відображення шрифта залежить від часу на початку завантаження шрифта та його використання. Типи хронології поділені на три частини які вказують поведінку відображення усих елементів які використовують цей шрифт.

- -
-
Блокування шрифту(block)
-
Якщо шрифт не завантажений, усі елементи які очікують на його використання мають відображатись невидимими(invisible). Якщо шрифт успішно завантажений за цей період, вони відображаются за замовчуванням.
-
Заміна шрифту(swap)
-
Якщо шрифт не завантажений, усі елементи що очікують на його використання , мають використати запасний шрифт. Якщо шрифт успішно завантажений за цей період, вони відображаются за замовчуванням.
-
Невдача(failure)
-
Якщо шрифт не був завантажений, клієнт відображає його як невдачно завантажений, що викликає звичайне резервування шрифту.
-
- -

{{cssinfo}}

- -

Синтаксис

- -
/* Keyword values */
-font-display: auto;
-font-display: block;
-font-display: swap;
-font-display: fallback;
-font-display: optional;
- -

Значення

- -
-
auto
-
Відображення шрифту виконуєтся автоматично клієнтом.
-
block
-
Надає елементам короткий період блокування і нескінченний swap період.
-
swap
-
Надає надзвичайно малий період блокування і нескінченний період підміни шрифту.
-
fallback
-
Надає надзвичайно малий період блокування і малий період підміни шрифту.
-
optional
-
Надає надзвичайно малий період блокування без підміни шрифту.
-
- -

Формальний синтаксис

- -{{csssyntax}} - -

Приклад

- -
@font-face {
-  font-family: ExampleFont;
-  src: url(/path/to/fonts/examplefont.woff) format('woff'),
-       url(/path/to/fonts/examplefont.eot) format('eot');
-  font-weight: 400;
-  font-style: normal;
-  font-display: fallback;
-}
- -

Специфікації

- - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('CSS4 Fonts', '#font-display-desc', 'font-display')}}{{Spec2('CSS4 Fonts')}}Initial definition
- -

Сумісність з браузерами

- - - -

{{Compat("css.at-rules.font-face.font-display")}}

diff --git a/files/uk/web/css/@font-face/index.html b/files/uk/web/css/@font-face/index.html deleted file mode 100644 index 0a7217c851..0000000000 --- a/files/uk/web/css/@font-face/index.html +++ /dev/null @@ -1,197 +0,0 @@ ---- -title: '@font-face' -slug: Web/CSS/@font-face -tags: - - '@-правила' - - '@font-face' - - CSS - - CSS Шрифти - - Посилання - - типографія - - шрифти -translation_of: Web/CSS/@font-face ---- -
{{CSSRef}}
- -

@font-face CSS @-правило вказує спеціальний шрифт для відображення текста. Шрифт може бути завантажений з зовнішнього сервера або встановлено локально на комп'ютері користувача. Якщо функція local() вказує ім'я шрифта то його пошук буде відбуватися  на комп'ютері користувача. Інакше ресурси шрифти вказані з використанням функції url() будуть завантажені і використані

- -

Дозвіл авторам впроваджувати їх власні шрифти дає можливість стилізувати контент без обмежень в так званих "безпечних" шрифтах (Це такі шрифти,що широко використовуються та визнані як загальнодоступні). Можливість вказувати ім'я локально встановлених шрифтів дає можливість налаштовувати шрифт більш гнучко без залежності від інтернет з'єднання.

- -

Поширеним випадком є використання url() і local() разом, що дає змогу використовувати втановлений користувачем шрифт і завантажувати шрифт у разі його відсутності на користувацькому пристрої.

- -

@font-face @-правило може бути використане не лише на вищому рівні CSS, а й всередині будь-якого @-правила.

- -
@font-face {
-  font-family: "Open Sans";
-  src: url("/fonts/OpenSans-Regular-webfont.woff2") format("woff2"),
-       url("/fonts/OpenSans-Regular-webfont.woff") format("woff");
-}
- -

Синтаксис

- -

Опис

- -
-
{{cssxref("@font-face/font-display", "font-display")}}
-
Вказує як шрифт відображатиметься в залежності від того чи він завантажений та готовий до використання.
-
{{cssxref("@font-face/font-family", "font-family")}}
-
Задає ім'я, що буде використовуватися для задання властивостей шрифта.
-
{{cssxref("@font-face/font-stretch", "font-stretch")}}
-
Значення {{cssxref("font-stretch")}} . Починаючи з Firefox 61 (та інших сучасних браузерів)  {{cssxref("font-stretch")}} також допускає задання двох значень для вказання діапазону, що підтримується шрифтом, наприклад: font-stretch: 50% 200%;
-
{{cssxref("@font-face/font-style", "font-style")}}
-
Значення {{cssxref("font-style")}}. Починаючи з Firefox 61 (і інших сучасних браузерів) {{cssxref("font-style")}}.також допускає задання двох значень для вказання діапазону, що підтримується шрифтом, наприклад: font-style: oblique 20deg 50deg;
-
{{cssxref("@font-face/font-weight", "font-weight")}}
-
Значення {{cssxref("font-weight")}}. Починаючи з Firefox 61 (і інших сучасних браузерів) {{cssxref("font-weight")}} також допускає задання двох значень для вказання діапазону, що підтримується шрифтом, наприклад: font-weight: 100 400;
-
{{cssxref("@font-face/font-variant", "font-variant")}}
-
Значення {{cssxref("font-variant")}}.
-
{{cssxref("font-feature-settings", "font-feature-settings")}}
-
Дозволяє контролювати інші розширені можлифості OpenType шрифтів.
-
{{cssxref("@font-face/font-variation-settings", "font-variation-settings")}}
-
Дозволяє здійснювати низькорівневий контроль над варіаціями шрифтів OpenType чи TrueType, вказуючи назви осей з чотирьох букв для зміни разом з їх значеннями.
-
{{cssxref("@font-face/src", "src")}}
-
-

Вказує ресурс, що містить дані шрифта.  Це може бути URL для віддаленого файлу шрифта чи ім'я для шрифта на комп'ютері користувача.

- -

Щоб дати браузеру підказку який вибрати формат ресурсу шрифта, формат можна вказати в середині функції format():

- -
src: url(ideal-sans-serif.woff) format("woff"),
-     url(basic-sans-serif.ttf) format("truetype");
- -

Достіпні типи: "woff", "woff2", "truetype", "opentype", "embedded-opentype", і "svg".

-
-
{{cssxref("@font-face/unicode-range", "unicode-range")}}
-
Діапазон  Unicode кодів, що буде використовуватись в шрифті.
-
- -

Формальний синтаксис

- -{{csssyntax}} - -

Приклади

- -

Цей приклад просто вказує завантажуваний шрифт для використання і застосовує його до всього тіла документа:

- -

Дивитися live приклад

- -
<html>
-<head>
-  <title>Web Font Sample</title>
-  <style type="text/css" media="screen, print">
-    @font-face {
-      font-family: "Bitstream Vera Serif Bold";
-      src: url("https://mdn.mozillademos.org/files/2468/VeraSeBd.ttf");
-    }
-
-    body { font-family: "Bitstream Vera Serif Bold", serif }
-  </style>
-</head>
-<body>
-  This is Bitstream Vera Serif Bold.
-</body>
-</html>
-
- -

В цьому прикладі використовується локальний шрифт користувача "Helvetica Neue Bold"; якщо у користувача цей шрифт не встановлений тоді натомість використовується завантажуваний шрифт "MgOpenModernaBold.ttf":

- -
@font-face {
-  font-family: MyHelvetica;
-  src: local("Helvetica Neue Bold"),
-       local("HelveticaNeue-Bold"),
-       url(MgOpenModernaBold.ttf);
-  font-weight: bold;
-}
-
- -

MIME-типи шрифтів

- - - - - - - - - - - - - - - - - - - - - - - - - - -
ФорматMIME-тип
TrueTypefont/ttf
OpenTypefont/otf
Web Open File Formatfont/woff
Web Open File Format 2font/woff2
- -

Нотатки

- - - -

Специфікація

- - - - - - - - - - - - - - - - - - - - - - - - - - -
СпецифікаціяСтатусКоментар
{{SpecName('WOFF2.0', '', 'WOFF2 font format')}}{{Spec2('WOFF2.0')}}Специфікація фомату шрифта з новим алгоритмом стиснення
{{SpecName('WOFF1.0', '', 'WOFF font format')}}{{Spec2('WOFF1.0')}}Специфікація формата шрифта
{{SpecName('CSS3 Fonts', '#font-face-rule', '@font-face')}}{{Spec2('CSS3 Fonts')}}Початкове визначення
- -

Підтримка браузерів 

- - - -

{{Compat("css.at-rules.font-face")}}

- -

Прогляньте також

- - diff --git a/files/uk/web/css/@page/bleed/index.html b/files/uk/web/css/@page/bleed/index.html deleted file mode 100644 index 3f7ef352e1..0000000000 --- a/files/uk/web/css/@page/bleed/index.html +++ /dev/null @@ -1,83 +0,0 @@ ---- -title: bleed -slug: Web/CSS/@page/bleed -tags: - - '@сторінка' - - CSS - - Web -translation_of: Web/CSS/@page/bleed ---- -
{{CSSRef}}{{SeeCompatTable}}
- -

 bleed це пропускний дескриптор правил css, використовується  з {{cssxref("@page")}} за правилом , визначає ступінь області пропуску сторінки за межами сторінки. Ця властивість має тільки ефект  якщо позначки обрізання   увімкнено за допомогою властивості {{cssxref("@page/marks", "marks")}} property.

- -

Syntax

- -
/* Keyword values */
-bleed: auto;
-
-/* <length> values */
-bleed: 8pt;
-bleed: 1cm;
-
- -

Значення

- -
-
auto
-
Обчислюється до 6pt якщо  значення в {{cssxref("@page/marks", "marks")}} є обрізаним. В іншому випадку він обчислюється до нуля.
-
{{cssxref("<довжина>")}}
-

- Вказує, наскільки назовні, в кожному напрямку, область випуску простягається поза полем сторінки. Значення можуть бути від’ємними, але можуть бути певні обмеження щодо реалізації.
-
- -

Формальне визначення

- -

{{cssinfo}}

- -

Формальний синтаксис

- -{{csssyntax}} - -

Приклади

- -

Встановлення кровоточення сторінки  в 1см.

- -
@page {
-  bleed: 1cm;
-}
-
- -

Специфікації

- - - - - - - - - - - - - - - - -
СпецифікаціяСтанКоментарі
{{SpecName("CSS3 Paged Media", "#bleed", "bleed")}}{{Spec2("CSS3 Paged Media")}}Initial definition
- -

Сувмістність з браузерами

- - - - - -

{{Compat("css.at-rules.page.bleed")}}

- -

Зазвичай переглядають

- - diff --git a/files/uk/web/css/@page/index.html b/files/uk/web/css/@page/index.html deleted file mode 100644 index 99089c653c..0000000000 --- a/files/uk/web/css/@page/index.html +++ /dev/null @@ -1,112 +0,0 @@ ---- -title: '@page' -slug: Web/CSS/@page -tags: - - '@page' - - At-rule - - CSS - - Layout - - NeedsTranslation - - Reference - - TopicStub - - Web -translation_of: Web/CSS/@page ---- -
{{CSSRef}}
- -

The @page CSS at-rule is used to modify some CSS properties when printing a document.

- -

Syntax

- -
@page {
-  margin: 1cm;
-}
-
-@page :first {
-  margin: 2cm;
-}
- -

Descriptors

- -
-
size
-
Specifies the target size and orientation of the page box’s containing block. In the general case, where one page box is rendered onto one page sheet, it also indicates the size of the destination page sheet.
-
- -
-
marks
-
Adds crop and/or registration marks to the document.
-
- -
-
bleed
-
Specifies the extent beyond the page box at which the page rendering is clipped.
-
- -

Description

- -

You can't change all CSS properties with @page. You can only change the margins, orphans, widows, and page breaks of the document. Attempts to change any other CSS properties will be ignored.

- -

The @page at-rule can be accessed via the CSS object model interface {{domxref("CSSPageRule")}}.

- -
Note: The W3C is discussing how to handle viewport-related {{cssxref("<length>")}} units, vh, vw, vmin, and vmax. Meanwhile do not use them within a @page at-rule.
- -

Formal syntax

- -{{csssyntax}} - -

Examples

- -

@page pseudo-class examples

- -

Please refer to the various pseudo-classes of @page for examples.

- - - -

Specifications

- - - - - - - - - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('CSS Logical Properties', '#page', ':recto and :verso')}}{{Spec2('CSS Logical Properties')}}Adds the :recto and :verso page selectors
{{SpecName('CSS3 Paged Media', '#at-page-rule', '@page')}}{{Spec2('CSS3 Paged Media')}}No change from {{SpecName('CSS2.1')}}, though more CSS at-rules can be used inside a @page.
{{SpecName('CSS2.1', 'page.html#page-selectors', '@page')}}{{Spec2('CSS2.1')}}Initial definition
- -

Browser compatibility

- - - -

{{Compat("css.at-rules.page")}}

- -

See also

- - diff --git a/files/uk/web/css/_colon_active/index.html b/files/uk/web/css/_colon_active/index.html deleted file mode 100644 index aa90d1e19b..0000000000 --- a/files/uk/web/css/_colon_active/index.html +++ /dev/null @@ -1,129 +0,0 @@ ---- -title: ':active' -slug: 'Web/CSS/:active' -tags: - - CSS - - Веб - - Довідка - - Макет - - Псевдоклас -translation_of: 'Web/CSS/:active' ---- -
{{CSSRef}}
- -

CSS псевдо-клас :active  відображає елемент (наприклад, кнопку), який в даний момент активовано користувачем. У випадку застосування миші, "активація" зазвичай починається в момент натискання основної клавіші.

- -
/* Вибирає будь-який <a>, що активується */
-a:active {
-  color: red;
-}
- -

Псевдоклас :active частіш за все використовується на елементах {{HTMLElement("a")}} і {{HTMLElement("button")}}. Інші поширені варіанти застосування цього селектору включають елементи, що містять активований елемент, а також елементи форм, які активуються через асоційований із ними  {{HTMLElement("label")}}.

- -

Стилі, задані псевдокласом :active будуть перевизначені будь-яким наступним спорідненим із посиланнями псевдокласом ({{cssxref(":link")}}, {{cssxref(":hover")}}, чи {{cssxref(":visited")}}), що має хоча б таку ж специфічність. Для правильної стилізації посилань помістіть правила :active після всіх інших споріднених із посиланнями правил, як визначено порядком LVHA: :link:visited:hover:active.

- -
Зауважте, що: на системах із багатокнопковими мишами CSS3 вказує, що псевдоклас :active повинен застосовуватись лише для основної кнопки; у випадку правосторонньої миші це зазвичай крайня ліва кнопка.
- -

Синтаксис

- -{{csssyntax}} - -

Приклади

- -

Активні посилання

- -

HTML

- -
<p>Цей абзац містить посилання:
-  <a href="#">Це посилання буде забарвлено у червоний при натисканні на нього.</a>
-  Цей абзац отримає сірий фон при натисканні на посилання.
-</p>
- -

CSS

- -
a:link { color: blue; }          /* Невідвідані посилання */
-a:visited { color: purple; }     /* Відвідані посилання */
-a:hover { background: yellow; }  /* Посилання із наведеним курсором */
-a:active { color: red; }         /* Активні посилання */
-
-p:active { background: #eee; }   /* Активні абзаци */
- -

Результат

- -

{{EmbedLiveSample('Активні_посилання')}}

- -

Активні елементи форм

- -

HTML

- -
<form>
-  <label for="my-button">Моя кнопка: </label>
-  <button id="my-button" type="button">Спробуйте натиснути на мене чи на мою мітку!</button>
-</form>
- -

CSS

- -
form :active {
-  color: red;
-}
-
-form button {
-  background: white;
-}
- -

Результат

- -

{{EmbedLiveSample('Активні_елементи_форм')}}

- -

Специфікації

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
СпецифікаціяСтатусПримітка
{{SpecName('HTML WHATWG', 'scripting.html#selector-active', ':active')}}{{Spec2('HTML WHATWG')}} 
{{SpecName('CSS4 Selectors', '#active-pseudo', ':active')}}{{Spec2('CSS4 Selectors')}}Без змін.
{{SpecName('CSS3 Selectors', '#useraction-pseudos', ':active')}}{{Spec2('CSS3 Selectors')}}Без змін.
{{SpecName('CSS2.1', 'selector.html#dynamic-pseudo-classes', ':active')}}{{Spec2('CSS2.1')}}Без змін.
{{SpecName('CSS1', '#anchor-pseudo-classes', ':active')}}{{Spec2('CSS1')}}Первинне визначення.
- -

Підтримка у браузерах

- -
- - -

{{Compat("css.selectors.active")}}

-
- -

Дивіться також

- - diff --git a/files/uk/web/css/_colon_root/index.html b/files/uk/web/css/_colon_root/index.html deleted file mode 100644 index 94153aa29d..0000000000 --- a/files/uk/web/css/_colon_root/index.html +++ /dev/null @@ -1,100 +0,0 @@ ---- -title: ':root' -slug: 'Web/CSS/:root' -tags: - - Псевдо-клас -translation_of: 'Web/CSS/:root' ---- -
{{CSSRef}}
- -

Опис

- -

Псевдо-клас :root вказує на кореневий елемент дерева документа. Якщо застосувати його до HTML, :root відображає {{HTMLElement("html")}} і є ідентичним селектору html, та не зважаючи на це, його вага є більшою.

- -

Синтаксис

- -{{csssyntax}} - -

Приклад

- -

Використання :root може бути корисним при декларуванні глобальних змінних CSS

- -
:root {
-  --main-color: hotpink;
-  --pane-padding: 5px 42px;
-}
-
- -

Специфікації

- - - - - - - - - - - - - - - - - - - - - -
СпецифікаціяСтанКоментар
{{SpecName('CSS4 Селектори', '#root-pseudo', ':root')}}{{Spec2('CSS4 Selectors')}}Без змін
{{SpecName('CSS3 Селектори', '#root-pseudo', ':root')}}{{Spec2('CSS3 Selectors')}}Початкове визначення
- -

Браузерна сумісність

- -

{{CompatibilityTable}}

- -
- - - - - - - - - - - - - - - - - - - -
ПідтримкаChromeFirefox (Gecko)Internet ExplorerOperaSafari
Базова1{{CompatGeckoDesktop("1.7")}}99.51.0
-
- -
- - - - - - - - - - - - - - - - - - - -
ПідтримкаAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Базова{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
diff --git a/files/uk/web/css/_doublecolon_before/index.html b/files/uk/web/css/_doublecolon_before/index.html deleted file mode 100644 index 675b0c375d..0000000000 --- a/files/uk/web/css/_doublecolon_before/index.html +++ /dev/null @@ -1,237 +0,0 @@ ---- -title: '::before (:before)' -slug: 'Web/CSS/::before' -tags: - - CSS - - Web - - Псевдо-елемент - - Розмытка -translation_of: 'Web/CSS/::before' ---- -
{{CSSRef}}
- -

В CSS, ::before створює псевдо-елемент, що є першим дочірнім елементом вибраного елемента. Це часто використовується для косметичного вмісту елемента з властивістю {{cssxref("content")}}. Він за замовчуванням лінійний

- -
/* Додає серце перед посиланнями */
-a::before {
-  content: "";
-}
- -
-

Нотатка: Псевдо-елемент згенерований за допомогою ::before і::after міститься в вікні форматування об'єкта, і таким чином не приймає замінювані елементи як  {{htmlelement("img")}}, або {{htmlelement("br")}} елементи.

-
- -

Синтаксис

- -{{csssyntax}} - -
-

Нотатка: CSS3 представляє позначення ::before (з двома двокрапками) щоб розрізняти псевдо-класи і псевдо-елементи. Браузер також приймає  :before, представлений в CSS2.

-
- -

Приклади

- -

Додавання лапок

- -

Простий приклад використання псевдо-елемента ::before додає лапки. Тут ми використовуємо і ::before і {{Cssxref("::after")}} замість символів лапок.

- -

HTML

- -
<q>Деякі цитати,</q> сказав він, <q> кращі за інші.</q>
- -

CSS

- -
q::before {
-  content: "«";
-  color: blue;
-}
-
-q::after {
-  content: "»";
-  color: red;
-}
- -

Результат

- -

{{EmbedLiveSample('Adding_quotation_marks', '500', '50', '')}}

- -

Декоративний приклад

- -

Ми можемо стилізувати текст чи зображення у властивості  {{cssxref("content")}} майже як завгодно.

- -

HTML

- -
<span class="ribbon">Зверніть увагу де помаранчевий блок</span>
- -

CSS

- -
.ribbon {
-  background-color: #5BC8F7;
-}
-
-.ribbon::before {
-  content: "Подивіться на цей помаранчевий блок.";
-  background-color: #FFBA10;
-  border-color: black;
-  border-style: dotted;
-}
- -

Результат

- -

{{EmbedLiveSample('Decorative_example', 450, 60)}}

- -

Список завдань

- -

В цьому прикладі ми створимо простий список завдань, використовуючи псевдо-елемент. Цей метод може часто використовуватись щоб додавати невеликі штрихи до  UI щоб покращити user experience.

- -

HTML

- -
<ul>
-  <li>Купити молоко</li>
-  <li>Вигуляти собаку</li>
-  <li>Вправи</li>
-  <li>Писати код</li>
-  <li>Грати музику</li>
-  <li>Відпочити</li>
-</ul>
-
- -

CSS

- -
li {
-  list-style-type: none;
-  position: relative;
-  margin: 2px;
-  padding: 0.5em 0.5em 0.5em 2em;
-  background: lightgrey;
-  font-family: sans-serif;
-}
-
-li.done {
-  background: #CCFF99;
-}
-
-li.done::before {
-  content: '';
-  position: absolute;
-  border-color: #009933;
-  border-style: solid;
-  border-width: 0 0.3em 0.25em 0;
-  height: 1em;
-  top: 1.3em;
-  left: 0.6em;
-  margin-top: -1em;
-  transform: rotate(45deg);
-  width: 0.5em;
-}
- -

JavaScript

- -
var list = document.querySelector('ul');
-list.addEventListener('click', function(ev) {
-  if (ev.target.tagName === 'LI') {
-     ev.target.classList.toggle('done');
-  }
-}, false);
-
- -

Вище - код живого прикладу. Відмітьте, що ми не використовуємо іконки, а галочкою являється псевдо-елемент ::before  які стилізовані за допомогою CSS.

- -

Результат

- -

{{EmbedLiveSample('To-do_list', 400, 300)}}

- -

Нотатки

- -

Також виправлення позиціонування в Firefox 3.5 не дозволяють вмісту бути згенерованим як окремий попередній елемент (відповідно до специфікації CSS "Псевдо-елемент :before і :after впливають на інші блоки так як вони були б справжніми елементами"), Вони можуть використовуватись, щоб впроваджувати незначні поліпшення для  не табличних розміток.  (наприклад, щоб досягти центрування) в випадку  доки вміст, що має центруватись  поміщений в дочірній наступний , колонка до і після контенту може бути представлена без додавання попереднього чи наступного сусіднього блоку (наприклад, це, можливо, найбільш семантично правильніше, додавати допоміжний span як нижче, чим додавати  <div/>  перед і після). (І завжди пам'ятайте додавати ширину до  float об'єкта, інакше він не буде обтікати!)

- -

HTML

- -
<div class="example">
-<span id="floatme">"Floated Before" має згенеруватись ліворуч від
-вікна перегляду і не виносити за межі рядка на потік нижче. Аналогічно
-"Floated After" має з'являтись праворуч</span>
-</div>
- -

CSS

- -
#floatme { float: left; width: 50%; }
-
-/* Щоб отримати пусту колонку просто позначте в hex коді
-  нерозривний пробіл: \a0 у якості контенту
-(Використовуйте \0000a0 коли іде після такого символа як пробіл )
-*/
-.example::before {
-  content: "Floated Before";
-  float: left;
-  width: 25%;
-}
-.example::after {
-  content: "Floated After";
-  float: right;
-  width: 25%;
-}
-
-/* For styling */
-.example::before, .example::after {
-  background: yellow;
-  color: red;
-}
- -

Результат

- -

{{EmbedLiveSample("Notes")}}

- -

Специфікація

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
СпецифікаціяСтатусКоментар
{{SpecName('CSS4 Pseudo-Elements', '#selectordef-before', '::before')}}{{Spec2('CSS4 Pseudo-Elements')}}No significant changes to the previous specification.
{{Specname("CSS3 Transitions", "#animatable-properties", "")}}{{Spec2("CSS3 Transitions")}}Allows transitions on properties defined on pseudo-elements.
{{Specname("CSS3 Animations", "", "")}}{{Spec2("CSS3 Animations")}}Allows animations on properties defined on pseudo-elements.
{{SpecName('CSS3 Selectors', '#gen-content', '::before')}}{{Spec2('CSS3 Selectors')}}Introduces the two-colon syntax.
{{SpecName('CSS2.1', 'generate.html#before-after-content', '::before')}}{{Spec2('CSS2.1')}}Initial definition, using the one-colon syntax
- -

Підтримка браузерів

- -
- - -

{{Compat("css.selectors.before")}}

-
- -

Дивіться також

- - diff --git a/files/uk/web/css/_doublecolon_slotted/index.html b/files/uk/web/css/_doublecolon_slotted/index.html deleted file mode 100644 index a363141b7c..0000000000 --- a/files/uk/web/css/_doublecolon_slotted/index.html +++ /dev/null @@ -1,104 +0,0 @@ ---- -title: '::slotted()' -slug: 'Web/CSS/::slotted' -translation_of: 'Web/CSS/::slotted' ---- -
{{ CSSRef }}
- -

Псевдо-елемент ::slotted() являє собою будь-який елемент, поміщений в слот всередині шаблону HTML (додаткову інформацію див. в розділі Використання шаблонів і слотів).

- -

Це працює тільки при використанні всередині CSS, поміщеного в тіньовий DOM. Зверніть увагу, що цей селектор не буде вибирати текстовий вузол, поміщений в слот; він призначений тільки для фактичних елементів.

- -
/* Вибір будь-якого елемента, поміщеного в слот */
-::slotted(*) {
-  font-weight: bold;
-}
-
-/* Вибір будь-якого <span> елемента, поміщеного в слот */
-::slotted(span) {
-  font-weight: bold;
-}
-
- -

Синтакс

- -{{csssyntax}} - -

Приклади

- -

Наступні фрагменти коду взяті з демо-версії застосування псевдо-елемента :slotted (див. демо).

- -

У цьому демо ми використовуємо простий шаблон з трьома слотами:

- -
<template id="person-template">
-  <div>
-    <h2>Personal ID Card</h2>
-    <slot name="person-name">NAME MISSING</slot>
-    <ul>
-      <li><slot name="person-age">AGE MISSING</slot></li>
-      <li><slot name="person-occupation">OCCUPATION MISSING</slot></li>
-    </ul>
-  </div>
-</template>
- -

Кастомний веб-компонент— <person-details> —  визначений, як:

- -
customElements.define('person-details',
-  class extends HTMLElement {
-    constructor() {
-      super();
-      let template = document.getElementById('person-template');
-      let templateContent = template.content;
-
-      const shadowRoot = this.attachShadow({mode: 'open'});
-
-      let style = document.createElement('style');
-      style.textContent = 'div { padding: 10px; border: 1px solid gray; width: 200px; margin: 10px; }' +
-                           'h2 { margin: 0 0 10px; }' +
-                           'ul { margin: 0; }' +
-                           'p { margin: 10px 0; }' +
-                           '::slotted(*) { color: gray; font-family: sans-serif; } ';
-
-      shadowRoot.appendChild(style);
-      shadowRoot.appendChild(templateContent.cloneNode(true));
-  }
-})
- -

Ви побачите, що при заповненні елемента стилю  певними значеннями, ми вибираємо всі слотовані елементи  (::slotted(*)) і надаємо їм інший шрифт і колір. Це дозволяє їм краще виділятися поруч зі слотами, які не були успішно заповнені. 

- -

Для вибору конкретних елементів, вказуєм необхідний тип елементу замість *.  Для прикладу - селектор, який застосує стилі лише для div елементів, матиме наступний вигляд (::slotted(div)). Більше інформації про стилізацію slot елементів та розробку кастомних веб компонентів, ви можете знайти на моєму github.

- -

При вставці на сторінку елемент виглядає наступним чином:

- -

<person-details> <p slot="person-name">Dr. Shazaam</p> <span slot="person-age">Immortal</span> <span slot="person-occupation">Superhero</span> </person-details>

- -

Cпецифікації

- - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{ SpecName('CSS Scope', '#slotted-pseudo', '::slotted') }}{{ Spec2('CSS Scope') }}Початкове визначення
- -

Сумісність браузерами

- - - -

{{Compat("css.selectors.slotted")}}

- -

Див. також

- - diff --git a/files/uk/web/css/alternative_style_sheets/index.html b/files/uk/web/css/alternative_style_sheets/index.html deleted file mode 100644 index f805d1d125..0000000000 --- a/files/uk/web/css/alternative_style_sheets/index.html +++ /dev/null @@ -1,81 +0,0 @@ ---- -title: Альтернативні таблиці стилів -slug: Web/CSS/Alternative_style_sheets -tags: - - Стилі - - Теми -translation_of: Web/CSS/Alternative_style_sheets -original_slug: Web/CSS/Альтернативні_таблиці_стилів ---- -

Specifying alternative style sheets in a web page provides a way for users to see multiple versions of a page, based on their needs or preferences.

- -

Firefox lets the user select the stylesheet using the View > Page Style submenu, Internet Explorer also supports this feature (beginning with IE 8), also accessed from View > Page Style (at least as of IE 11), but Chrome requires an extension to use the feature (as of version 48). The web page can also provide its own user interface to let the user switch styles.

- -

An example: specifying the alternative stylesheets

- -

The alternate stylesheets are commonly specified using a {{HTMLElement("link")}} element with rel="stylesheet alternate" and title="..." attributes, for example:

- -
<link href="reset.css" rel="stylesheet" type="text/css">
-
-<link href="default.css" rel="stylesheet" type="text/css" title="Default Style">
-<link href="fancy.css" rel="alternate stylesheet" type="text/css" title="Fancy">
-<link href="basic.css" rel="alternate stylesheet" type="text/css" title="Basic">
-
- -

In this example, the styles "Default Style", "Fancy", and "Basic" will be listed in the Page Style submenu, with the Default Style pre-selected. When the user selects a different style, the page will immediately be re-rendered using that style sheet.

- -

No matter what style is selected, the rules from the reset.css stylesheet will always be applied.

- -

Try it out

- -

Click here for a working example you can try out.

- -

Details

- -

Any stylesheet in a document falls into one of the following categories:

- - - -

When style sheets are referenced with a title attribute on the {{HTMLElement("link", "<link rel=\"stylesheet\">")}} or {{HTMLElement("style")}} element, the title becomes one of the choices offered to the user. Style sheets linked with the same title are part of the same choice. Style sheets linked without a title attribute are always applied.

- -

Use rel="stylesheet" to link to the default style, and rel="alternate stylesheet" to link to alternative style sheets. This tells the browser which style sheet title should be selected by default, and makes that default selection apply in browsers that do not support alternate style sheets.

- -

Specifications

- - - - - - - - - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('CSSOM', '#css-style-sheet-collections', 'CSS Style Sheet Collections')}}{{Spec2('CSSOM')}}The CSS OM specification defines the concepts of the style sheet set name, its disabled flag, and the preferred CSS style sheet set name.
- It defines how these are determined, and lets the HTML specification define the HTML-specific behaviors by requiring it to define when to create a CSS style sheet.
-

{{SpecName('HTML WHATWG', 'semantics.html#link-type-stylesheet', 'Link type "stylesheet"')}}
- {{SpecName('HTML WHATWG', 'semantics.html#attr-style-title', 'The style element')}}
- {{SpecName('HTML WHATWG', 'semantics.html#attr-meta-http-equiv-default-style', 'Default style state (http-equiv="default-style")')}}

-
{{Spec2('HTML WHATWG')}}The HTML specification defines when and how the create a CSS style sheet algorithm is invoked while handling <link> and <style> elements, and also defines the behavior of <meta http-equiv="default-style">.
{{SpecName("HTML4.01", "present/styles.html#h-14.3", "Alternative style sheets")}}{{Spec2("HTML4.01")}}Earlier, the HTML specification itself defined the concept of preferred and alternate stylesheets.
- -

 

diff --git a/files/uk/web/css/animation-name/index.html b/files/uk/web/css/animation-name/index.html deleted file mode 100644 index c600b3ecd1..0000000000 --- a/files/uk/web/css/animation-name/index.html +++ /dev/null @@ -1,141 +0,0 @@ ---- -title: animation-name -slug: Web/CSS/animation-name -translation_of: Web/CSS/animation-name ---- -
{{CSSRef}}
- -
Animation-name - це властивість CSS, яка визначає одну або декілька анімацій, які повинні бути застосовані на елементі. Кожне animation-name вказує на {{cssxref("@keyframes")}} правило, яке визначає значення властивостей для анімаційного ряду.
- -
 
- -
/* Single animation */
-animation-name: none;
-animation-name: test_05;
-animation-name: -specific;
-animation-name: sliding-vertically;
-
-/* Multiple animations */
-animation-name: test1, animation4;
-animation-name: none, -moz-specific, sliding;
-
-/* Global values */
-animation-name: initial
-animation-name: inherit
-animation-name: unset
- -

Часто, буде зручно користуватися коротким варіантом  {{cssxref("animation")}} для встановлення усіх властивостей анімації за один раз.

- -

{{cssinfo}}

- -

Syntax

- -

Values

- -
-
none
-
Значення, яке вказує на відсутність основних кадрів (keyframes). Може бути використано для деактивації анімації без зміни інших параметрів анімації, or to deactivate animations coming from the cascade.
-
{{cssxref("<custom-ident>")}}
-
Ім'я анімації. Цей ідентифікатора складається з комбінаціїThis identifier is composed of a combination of літер a-z (без врахування регістру літер), цифр 0-9, підкреслення (_), і/або дефісу (-). The first non-dash character must be a letter. Also, two dashes are forbidden at the beginning of the identifier. Furthermore, the identifier can't be none, unset, initial, or inherit.
-
- -
-

Note: When you specify multiple comma-separated values on an animation-* property, they will be assigned to the animations specified in the {{cssxref("animation-name")}} property in different ways depending on how many there are. For more information, see Setting multiple animation property values.

-
- -

Formal syntax

- -{{csssyntax}} - -

Examples

- -

See CSS animations for examples.

- -

Specifications

- - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('CSS3 Animations', '#animation-name', 'animation-name')}}{{Spec2('CSS3 Animations')}}Initial definition.
- -

Browser compatibility

- -
{{CompatibilityTable}}
- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support{{CompatVersionUnknown}}{{property_prefix("-webkit")}}
- {{CompatChrome(43.0)}}
{{CompatVersionUnknown}}{{property_prefix("-webkit")}}
- {{CompatVersionUnknown}}
{{CompatGeckoDesktop("5.0")}}{{property_prefix("-moz")}}
- {{CompatGeckoDesktop("16.0")}}[1]
10 12 {{property_prefix("-o")}}
- 12.10
4.0{{property_prefix("-webkit")}}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidEdgeFirefox Mobile (Gecko)IE PhoneOpera MobileSafari MobileChrome for Android
Basic support{{CompatUnknown}}{{CompatVersionUnknown}}{{property_prefix("-webkit")}}
- {{CompatVersionUnknown}}
{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
- -

[1] In addition to the unprefixed support, Gecko 44.0 {{geckoRelease("44.0")}} added support for a -webkit- prefixed version of the property for web compatibility reasons behind the preference layout.css.prefixes.webkit, defaulting to false. Since Gecko 49.0 {{geckoRelease("49.0")}} the preference defaults to true.

- -

See also

- - diff --git a/files/uk/web/css/attr()/index.html b/files/uk/web/css/attr()/index.html deleted file mode 100644 index 85afa37991..0000000000 --- a/files/uk/web/css/attr()/index.html +++ /dev/null @@ -1,265 +0,0 @@ ---- -title: attr() -slug: Web/CSS/attr() -tags: - - CSS - - CSS функція - - Web - - attr - - Макет -translation_of: Web/CSS/attr() ---- -
{{CSSRef}}
- -
- -
- -
Примітка: Функція attr() може буті використана з будь-якою властивісттю CSS, але підтримка для властивостей інших ніж {{CSSxRef("content")}} є експериментальною, і підтримка для параметру type-or-unit обмежена.
- -
- -

Функція attr() в CSS використовується для повернення значення атрибуту вибраного елементу і використання його в таблиці стилів. Вона може бути використана на псевдоелементах, і в цьому випадку повертається значення атрибута для використання в якості тексту псевдоелемента.

- -
/* Просте застосування */
-attr(data-count);
-attr(title);
-
-/* З параметром type */
-attr(src url);
-attr(data-count number);
-attr(data-width px);
-
-/* З параметром  fallback */
-attr(data-count number, 0);
-attr(src url, "");
-attr(data-width px, inherit);
-attr(data-something, "default");
-
-
- -

Синтаксис

- -

Значення

- -
-
attribute-name
-
Це ім'я атрибута елемента HTML, на який функція посилається у CSS.
-
<type-or-unit> {{Experimental_Inline}}
-
Це ключове слово, що представляє або тип значення атрибута, або його одиницю, оскільки в HTML деякі атрибути мають неявні одиниці. Якщо використання <type-or-unit> як значення для даного атрибуту недійсне, вираз з attr() також буде недійсним. Якщо пропущено, за замовчуванням використовується string. Список дійсних значень: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ключове словоАсоційований типКоментарЗначення за замовчуванням
string{{CSSxRef("<string>")}}Значення атрибута трактується як CSS {{CSSxRef("<string>")}}. Воно НЕ буде оброблюватися, і зокрема символи будуть використані як-є замість того, щоб маскування CSS перетворювалися на інші символи.Пустий рядок.
color {{Experimental_Inline}}{{CSSxRef("<color>")}}Значення атрибуту аналізується як хеш (3- або 6-значні хеші) або як ключове слово. Повінне бути дійсним значенням CSS {{CSSxRef("<string>")}}.
- Провідні і кінцеві прогалини будуть прибрані.
currentColor
url {{Experimental_Inline}}{{CSSxRef("<url>")}}Значення атрибута аналізується як CSS рядок що використовується всередині CSS функції url().
- Відносна URL-адреса вирішується відносно оригінального документа, а не щодо таблиці стилів.
- Провідні і кінцеві прогалини будуть прибрані.
The url about:invalid that points to a non-existent document with a generic error condition.
integer {{Experimental_Inline}}{{CSSxRef("<integer>")}}Значення атрибута аналізується як CSS {{CSSxRef("<integer>")}}. Якщо воно не є дійсним значенням, тобто не є числом або виходить за межі діапазону, прийнятого властивістю CSS, використовується значення за замовчуванням.
- Провідні і кінцеві прогалини будуть прибрані.
0, або, якщо 0 не є дійсним значенням для властивості, мінімальним значенням властивості.
number {{Experimental_Inline}}{{CSSxRef("<number>")}}Значення атрибута аналізується як CSS {{CSSxRef("<number>")}}. Якщо воно не є дійсним значенням, тобто не є числом або виходить за межі діапазону, прийнятого властивістю CSS, використовується значення за замовчуванням.
- Провідні і кінцеві прогалини будуть прибрані.
0, або, якщо 0 не є дійсним значенням для властивості, мінімальним значенням властивості.
length {{Experimental_Inline}}{{CSSxRef("<length>")}}Значення атрибута аналізується як CSS {{CSSxRef("<length>")}} вимір, що вміщує одиниці виміру (наприклад, 12.5em). Якщо воно не є дійсним значенням, тобто не є довжиною або виходить за межі діапазону, прийнятого властивістю CSS, використовується значення за замовчуванням.
- Якщо дана одиниця виміру є відносною довжиною, attr () обчислює її до абсолютної довжини
- Провідні і кінцеві прогалини будуть прибрані.
0, або, якщо 0 не є дійсним значенням для властивості, мінімальним значенням властивості.
em, ex, px, rem, vw, vh, vmin, vmax, mm, cm, in, pt, or pc {{Experimental_Inline}}{{CSSxRef("<length>")}}Значення атрибута аналізується як CSS {{CSSxRef("<number>")}}, що не містить одиниць виміру (e.g. 12.5), і трактується як {{CSSxRef("<length>")}} з вказаними одиницями виміру. Якщо воно не є дійсним значенням, тобто не є довжиною або виходить за межі діапазону, прийнятого властивістю CSS, використовується значення за замовчуванням.
- Якщо дана одиниця виміру є відносною довжиною, attr () обчислює її до абсолютної довжини
- Провідні і кінцеві прогалини будуть прибрані.
0, або, якщо 0 не є дійсним значенням для властивості, мінімальним значенням властивості.
angle {{Experimental_Inline}}{{CSSxRef("<angle>")}}Значення атрибута аналізується як CSS {{CSSxRef("<angle>")}} вимір, із зазначеними одиницями віміру (наприклад, 30.5deg). Якщо воно не є дійсним значенням, тобто не є мірою кута або виходить за межі діапазону, прийнятого властивістю CSS, використовується значення за замовчуванням.
- Провідні і кінцеві прогалини будуть прибрані.
0deg, або, якщо 0deg не є дійсним значенням для властивості, мінімальним значенням властивості.
deg, grad, rad {{Experimental_Inline}}{{CSSxRef("<angle>")}}Значення атрибута аналізується як CSS {{CSSxRef("<number>")}}, тобто без одиниць виміру (наприклад, 12.5), і трактується як  {{CSSxRef("<angle>")}} із зазначеними одиницями віміру. Якщо воно не є дійсним значенням, тобто не є числом або виходить за межі діапазону, прийнятого властивістю CSS, використовується значення за замовчуванням.
- Провідні і кінцеві прогалини будуть прибрані.
0deg, або, якщо 0deg не є дійсним значенням для властивості, мінімальним значенням властивості.
time {{Experimental_Inline}}{{CSSxRef("<time>")}}Значення атрибута аналізується як CSS {{CSSxRef("<time>")}} вимір, із зазначеними одиницями віміру (наприклад, 30.5ms). Якщо воно не є дійсним значенням, тобто не є значенням часу або виходить за межі діапазону, прийнятого властивістю CSS, використовується значення за замовчуванням.
- Провідні і кінцеві прогалини будуть прибрані.
0s, або, якщо 0s не є дійсним значенням для властивості, мінімальним значенням властивості.
s, ms {{Experimental_Inline}}{{CSSxRef("<time>")}}Значення атрибута аналізується як CSS {{CSSxRef("<number>")}}, що не містить одиниць виміру (наприклад, 12.5), і трактується як {{CSSxRef("<time>")}} із зазначеними одиницями віміру. Якщо воно не є дійсним значенням, тобто не є числом або виходить за межі діапазону, прийнятого властивістю CSS, використовується значення за замовчуванням.
- Провідні і кінцеві прогалини будуть прибрані..
0s, або, якщо 0s не є дійсним значенням для властивості, мінімальним значенням властивості.
frequency {{Experimental_Inline}}{{CSSxRef("<frequency>")}}Значення атрибута аналізується як CSS {{CSSxRef("<frequency>")}} вимір, із зазначеними одиницями віміру (наприклад, 30.5kHz). Якщо воно не є дійсним значенням, тобто не є частотою або виходить за межі діапазону, прийнятого властивістю CSS, використовується значення за замовчуванням.0Hz, або, якщо 0Hz не є дійсним значенням для властивості, мінімальним значенням властивості.
Hz, kHz {{Experimental_Inline}}{{CSSxRef("<frequency>")}}Значення атрибута аналізується як CSS {{CSSxRef("<number>")}}, тобто без одиниць виміру (наприклад, 12.5), і трактується як {{CSSxRef("<frequency>")}} із зазначеними одиницями віміру. Якщо воно не є дійсним значенням, тобто не є частотою або виходить за межі діапазону, прийнятого властивістю CSS, використовується значення за замовчуванням.
- Провідні і кінцеві прогалини будуть прибрані.
0Hz, або, якщо 0Hz не є дійсним значенням для властивості, мінімальним значенням властивості.
% {{Experimental_Inline}}{{CSSxRef("<percentage>")}}Значення атрибута аналізується як CSS {{CSSxRef ("<number>")}}, тобто без одиниць виміру (наприклад, 12.5), і інтерпретується як {{CSSxRef ("<percentage>")}}. Якщо воно не є дійсним значенням, тобто не є числом або виходить за межі діапазону, прийнятого властивістю CSS, використовується значення за замовчуванням.
- Якщо дане значення використовується як довжина, attr () обчислює його до абсолютної довжини.
- Провідні і кінцеві прогалини будуть прибрані.
0%, або, якщо 0% не є дійсним значенням для властивості, мінімальним значенням властивості.
-
-
<fallback> {{Experimental_Inline}}
-
Значення, яке буде використовуватися, якщо пов'язаний атрибут відсутній або містить неприпустиме значення. Резервне значення має бути допустимим, якщо вказано attr(), навіть якщо воно не використовується, і не повинно містити іншого виразу attr(). Якщо attr() не є єдиним значенням компонента властивості, його значення <fallback> повинно мати тип, визначений <type-or-unit>. Якщо не встановлено, CSS буде використовувати значення за замовчуванням, визначений для кожного <type-or-unit>.
-
- -

Формальний синтаксис

- -{{CSSSyntax}} - -

Приклади

- -

Властивість content

- -

HTML

- -
<p data-foo="hello">world</p>
- -

CSS

- -
[data-foo]::before {
-  content: attr(data-foo) " ";
-}
- -

Результат

- -

{{EmbedLiveSample("content_property", "100%", 50)}}

- -

<color> значення

- -

{{SeeCompatTable}}

- -
-

HTML

- -
<div class="background" data-background="lime">background expect to be red if your browser does not support adavanced usage of attr()</div>
- -

CSS

- - - -
.background {
-  background-color: red;
-}
-
-.background[data-background] {
-  background-color: attr(data-background color, red);
-}
-
- -

Результат

- -

{{EmbedLiveSample("color-value", "100%", 50)}}

- -

Специфікації

- - - - - - - - - - - - - - - - - - - - - - - - - - -
СпецифікаціяСтатусКоментар
{{SpecName("CSS4 Values", "#attr-notation", "attr()")}}{{Spec2("CSS4 Values")}}Без змін.
{{SpecName("CSS3 Values", "#attr-notation", "attr()")}}{{Spec2("CSS3 Values")}} -

Додано два не обов'язкові параметри;
- може використовуватися зі всіма властивостями;
- може повертати інші значення, крім {{CSSxRef("<string>")}}.

- Ці зміни експериментальні і можуть бути скасовані під час фази CR, якщо підтримка браузерів занадто мала.
{{SpecName("CSS2.1", "generate.html#x18", "attr()")}}{{Spec2("CSS2.1")}}Обмежено властивісттю {{CSSxRef("content")}};
- завжди повертає {{CSSxRef("<string>")}}.
- -

Сумісність браузерів

- - - -

{{Compat("css.types.attr")}}

- -

Також перегляньте

- - diff --git a/files/uk/web/css/backdrop-filter/index.html b/files/uk/web/css/backdrop-filter/index.html deleted file mode 100644 index 6701367b35..0000000000 --- a/files/uk/web/css/backdrop-filter/index.html +++ /dev/null @@ -1,136 +0,0 @@ ---- -title: backdrop-filter -slug: Web/CSS/backdrop-filter -translation_of: Web/CSS/backdrop-filter ---- -
{{CSSRef}}{{SeeCompatTable}}
- -

Властивість backdrop-filter дозволяє застосувати графічні ефекти, такі як розмиття або зміщення кольорів до області позаду елемента. Оскільки це стосується всього, що стоїть поза елементом, щоб побачити ефект, ви повинні зробити елемент або його фон принаймні частково прозорим.

- -
/* Значення ключового слова */
-backdrop-filter: none;
-
-/* URL до SVG фільтру */
-backdrop-filter: url(commonfilters.svg#filter);
-
-/* Значення фільтру функцій */
-backdrop-filter: blur(2px);
-backdrop-filter: brightness(60%);
-backdrop-filter: contrast(40%);
-backdrop-filter: drop-shadow(4px 4px 10px blue);
-backdrop-filter: grayscale(30%);
-backdrop-filter: hue-rotate(120deg);
-backdrop-filter: invert(70%);
-backdrop-filter: opacity(20%);
-backdrop-filter: sepia(90%);
-backdrop-filter: saturate(80%);
-
-/* Кілька фільтрів */
-backdrop-filter: url(filters.svg#filter) blur(4px) saturate(150%);
-
-/* Глобальні значення */
-backdrop-filter: inherit;
-backdrop-filter: initial;
-backdrop-filter: unset;
-
- -

{{cssinfo}}

- -

Синтаксис

- -

Значення

- -
-
none
-
Фільтр відключений для фону
-
<filter-function-list>
-
Перелік фільтрів, розділених пробілами які застосовані для фону. Список фільтрів такий же як і для властивості filter.
-
- -

Формальний синтаксис

- -{{csssyntax}} - -

Приклад

- -

CSS

- -
.box {
-  background-color: rgba(255, 255, 255, 0.3);
-  border-radius: 5px;
-  font-family: sans-serif;
-  text-align: center;
-  line-height: 1;
-  backdrop-filter: blur(10px);
-  -webkit-backdrop-filter: blur(10px);
-  max-width: 50%;
-  max-height: 50%;
-  padding: 20px 40px;
-}
-
-html,
-body {
-  height: 100%;
-  width: 100%;
-}
-
-body {
-  background-image: url('https://lorempixel.com/400/200/');
-  background-position: center center;
-  background-repeat: no-repeat;
-  background-size: cover;
-}
-
-.container {
-  align-items: center;
-  display: flex;
-  justify-content: center;
-  height: 100%;
-  width: 100%;
-}
- -

HTML

- -
<div class="container">
-  <div class="box">
-    <p>backdrop-filter: blur(10px)</p>
-  </div>
-</div>
-
- -

Результат

- -

{{EmbedLiveSample("Example", 600, 400)}}

- -

Специфікації

- - - - - - - - - - - - - - - - -
СпецифікацяСтатусКоментар
{{SpecName('Filters 2.0', '#BackdropFilterProperty', 'backdrop-filter')}}{{Spec2('Filters 2.0')}}Initial definition.
- -

Сумісність з браузерами

- - - -

{{Compat("css.properties.backdrop-filter")}}

- -

Дивіться також

- - diff --git a/files/uk/web/css/css_animations/index.html b/files/uk/web/css/css_animations/index.html deleted file mode 100644 index 9b1af6c15e..0000000000 --- a/files/uk/web/css/css_animations/index.html +++ /dev/null @@ -1,140 +0,0 @@ ---- -title: CSS Animations -slug: Web/CSS/CSS_Animations -tags: - - CSS - - CSS анімації - - Довідка - - Огляд -translation_of: Web/CSS/CSS_Animations ---- -
{{CSSRef}}
- -

CSS-анімації - це модуль CSS, який дозволяє вам змінювати значення CSS-правил впродовж певного часу, використовуючи ключові кадри (keyframes). Поведінка цих анімацій може контролюватися шляхом встановлення їх функцій синхронізації, тривалості, числа повторів, та інших атрибутів.

- -

Довідка

- -

CSS Властивості

- -
- -
- -

CSS @-правила

- -
- -
- -

Посібники

- -
-
Виявлення підтримки CSS-анімації
-
Описує техніку виявлення підтримки браузером CSS-анімації.
-
Використання CSS анімацій
-
Покроковий підручник про те, як створити анімацію засобами CSS. Дана стаття описує кожне відповідне CSS властивість і at-правило, та пояснює, як вони взаємодіють між собою.
-
Підказки і хитрощі для CSS анімацій
-
Підказки і хитрощі, які допоможуть вам досягти якнайкращих результатів у CSS-анімаціях. В даний момент описує техніку, що дозволяє програти спочатку уже запущену анімацію (API не підтримує напряму такий функціонал).
-
- -

Специфікації

- - - - - - - - - - - - - - - - -
СпецифікаціяСтатусКоментар
{{ SpecName('CSS3 Animations') }}{{ Spec2('CSS3 Animations') }}Початкове визначення.
- -

Сумісність із браузерами

- -
{{CompatibilityTable}}
- -
- - - - - - - - - - - - - - - - - - - - - -
ВластивістьChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Базова підтримка{{CompatVersionUnknown}}{{property_prefix("-webkit")}}
- 43.0
{{CompatVersionUnknown}}{{CompatGeckoDesktop("5.0")}}{{property_prefix("-moz")}}
- {{CompatGeckoDesktop("16.0")}}
1012{{property_prefix("-o")}}
- 12.10[2]
4.0{{property_prefix("-webkit")}}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
ВластивістьAndroidEdgeFirefox Mobile (Gecko)IE PhoneOpera MobileSafari Mobile
Basic support2.1 {{property_prefix("-webkit")}} [1]
- 4.0 {{property_prefix("-webkit")}}
{{CompatVersionUnknown}}{{CompatGeckoMobile("5.0")}}{{property_prefix("-moz")}}
- {{CompatGeckoMobile("16.0")}}
{{CompatUnknown}}{{CompatUnknown}}{{CompatVersionUnknown}}{{property_prefix("-webkit")}}
-
- -

[1] Часткова підтримка: властивість {{cssxref("animation-fill-mode")}} не підтримується в Android браузері до версії 2.3.

- -

[2] Ознайомтесь із release notes to Opera 12.50.

- -

Дивіться також

- - - -

 

diff --git a/files/uk/web/css/css_animations/using_css_animations/index.html b/files/uk/web/css/css_animations/using_css_animations/index.html deleted file mode 100644 index eb125ac0af..0000000000 --- a/files/uk/web/css/css_animations/using_css_animations/index.html +++ /dev/null @@ -1,358 +0,0 @@ ---- -title: Використання CSS анімацій -slug: Web/CSS/CSS_Animations/Using_CSS_animations -tags: - - CSS Animations - - Довідка -translation_of: Web/CSS/CSS_Animations/Using_CSS_animations -original_slug: Web/CSS/CSS_Animations/Використання_CSS_анімацій ---- -

{{SeeCompatTable}}{{CSSRef}}

- -

CSS анімації роблять можливим анімацію переходів (transitions) з однєї конфігурації CSS стилю до іншої. Анімації складаються з двох компонентів, а власне - стилю, котрий описує CSS анімацію та набір ключових кадрів (keyframes), які задають початковий та кінцевий стан стилю анімації, а також є можливим задання точок проміжного стану.

- -

В CSS анімацій є три ключові переваги перед традиційними скриптовими техніками анімації:

- -
    -
  1. Вони легкі у використанні для простих анімацій; ви можете створити їх навіть без знань JavaScript.
  2. -
  3. Анімації добре функціонують, навіть при помірному навантаженні на систему. Прості анімації на JavaScript можуть працювати не дуже добре (в разі, якщо вони не ідеально зроблені). Движок рендера може використовувати техніку пропуску кадрів та інші засоби для підтримки гладкої анімації.
  4. -
  5. Надаючи таким чином браузеру контроль над послідовністю анімації ви надаєте можливість брауцзеру оптимізувати свою роботу та ефективність, наприклад, завдяки зупинці анімації у вкладках, які не є відкриті для перегляду.
  6. -
- -

Конфігурування анімації

- -

Щоб створити CSS-анімаційну послідвність, ви стилізуєте анімований елемент {{ cssxref("animation") }} властивістю чи її підвластивостями. Це дозвоялє вам коригувати таймінг, тривалість та інші деталі анімації згідно з вашими потребами. Це не конфігурує актуальний вигляд анімації, яка здійснюється проходом через {{ cssxref("@keyframes") }} at-правила, як це описано в {{ anch("Визначення послідовності анімації через ключові кадри") }} нижче.

- -

Підвластивостями властивості {{ cssxref("animation") }} є:

- -
-
{{ cssxref("animation-delay") }}
-
Змінює час затримки між часом з моменту завантаження елемента та початком анімаційної послідовності.
-
{{ cssxref("animation-direction") }}
-
Визначає зміну напрямку анімації та його чергування в залежності від кількості проходів анімації, а також може задавати повернення в початковий стан і починати прохід заново.
-
{{ cssxref("animation-duration") }}
-
Визначає тривалість циклу анімації.
-
{{ cssxref("animation-iteration-count") }}
-
Визначає кількість проходів (повторів) анімації; ви можете також обрати значення infinite для нескінченного повтору анімації.
-
{{ cssxref("animation-name") }}
-
Задає ім'я для анімації {{ cssxref("@keyframes") }} через at-правило, яке описує анімаційні ключові кадри.
-
{{ cssxref("animation-play-state") }}
-
Дозволяє вам призупиняти та відновлювати анімацію.
-
{{ cssxref("animation-timing-function") }}
-
Задає конфігурацію таймінгу анімації; інакше кажучи, як саме буде анімація робити прохід через ключові кадри, це можливо завдяки кривим прискорення.
-
{{ cssxref("animation-fill-mode") }}
-
Визначає, які значення будуть застосовані для анімації перед початком та після її закінчення.
-
- -

Визначення послідовності анімації через ключові кадри

- -

Опісля того, як ви задали анімації таймінг, вам потрібно задати вигляд анімації. Це робиться завдяки одному чи більше  ключовому кадру шляхом застосування at-правила {{ cssxref("@keyframes") }}. Кожен ключовий кадр описує, як саме повинен відображатися анімований елемент у певний момент під час проходження анімаційної послідовності.

- -

Після того, як таймінг анімації був заданий в CSS стилі, який конгфігурує анімацію, ключові кадри використовують {{ cssxref("percentage") }} для відображення моменту під час анімації, в якому буде розміщений той чи інший ключовий кадр. 0% вказує на сам початок анімаціїйної послідовності, тоді як 100% вказує на завершальний етап анімації. Оскільки ці два моменти є такими важливими, вони мають свої спеціальні імена: from і to відповідно. Обидва ці імені є необов'язковими. Якщо from/0% чи to/100% не є задано, то браузер починає чи зупиняє анімацію використовуючи середньообраховані значення всіх атрибутів.

- -

Ви також можете на свій розсуд додавати проміжні кадри до анімації, аби описати стан анімації в проміжні періоди.

- -

Приклади

- -
Примітка: Подані приклади не використовують вендорних префіксів. WebKit-браузери та старіші версії інших браузерів можуть потребувати цих префіксів; приклади, на які ви можете клацнути для перегляду у вашому браузері також включають -webkit-префіксовані версії.
- -

Текст, що ковзає у вікні браузера

- -

Цей простий приклад стилізує елемент {{ HTMLElement("p") }} так, що текст "зісковзує" в вікно браузера з-поза його правого краю.

- -

Майте на увазі, що такі анімації можуть робити сторінку ширшою, аніж вікно браузера. Аби уникнути такої проблеми, потрібно помістити анімований елемент в контейнер і встановити для останнього {{cssxref("overflow")}}:hidden.

- -
p {
-  animation-duration: 3s;
-  animation-name: slidein;
-}
-
-@keyframes slidein {
-  from {
-    margin-left: 100%;
-    width: 300%;
-  }
-
-  to {
-    margin-left: 0%;
-    width: 100%;
-  }
-}
-
- -

В цьому прикладі стиль для {{ HTMLElement("p") }}-елемента визначає, що тривалість анімації становить 3 секунди від початку до кінця, використовуючи властивість {{ cssxref("animation-duration") }}, а також присвоює ім'я цій анімації, яке використано у ключових кадрах {{ cssxref("@keyframes") }} . Їхні at-правила визначили, що це ключові кадри для анімації, яка називається “slidein”.

- -

Якщо нам потрібно ще якусь додаткову стилізацію елемента {{ HTMLElement("p") }} для відобаження в браузерах, які не підтримують CSS анімацій, то ми б її включили туди ж; однак, в цьому випадку ми не потребуємо додаткової стилізації, крім анімації елемента.

- -

Ключові кадри визначені через  at-правила {{ cssxref("@keyframes") }}. В даному випадку є лише два ключових кадри. Перший ключовий кадр наступає в 0% (вжито спеціальне ім'я from). Тут, ми змінюємо лівий маргін елемента як 100% (тобто це відраховується, як відстань від правого краю контейнера), і встановили 300% ширини для елемента (Втричі ширше за контейнер). Завдяки цьому на першому ключовому кадрі анімований елемент буде знаходитися поза межами контейнера (вікна браузера).

- -

Другий ключовий кадр (він же завершальний) розміщений на завершенні анімації, 100% (спеціальне ім'я to). Лівий маргін встановлено як 0% і ширину елемента ми встановили як 100%. Це спричиняє "приклеювання" елемента до лівого краю вікна браузера.

- -
<p>The Caterpillar and Alice looked at each other for some time in silence:
-at last the Caterpillar took the hookah out of its mouth, and addressed
-her in a languid, sleepy voice.</p>
-
- -

(Перезавантажте сторінку, аби побачити анімацію, або ж клікніть на кнопку CodePen, щоб побачити анімацію в середовищі CodePen)

- -

{{EmbedLiveSample("Making_text_slide_across_the_browser_window","100%","250")}}

- -

Додавання інших ключових кадрів

- -

Давайте додамо ще один ключовий кадр до анімації з попереднього прикладу. Припустимо, нам потрібно трішки збільшити шрифт, коли текст рухається вліво, а потім ми його повертаємо до попередніх параметрів. Це просто, як додавання ось такого ключового кадру:

- -
75% {
-  font-size: 300%;
-  margin-left: 25%;
-  width: 150%;
-}
-
- - - - - -

Це повідомляє браузеру, що елемент, при виконанні 75% анімації, повинен мати лівий маргін 25% і ширину 150%.

- -

(Перезавантажте сторінку, аби побачити анімацію, або ж клікніть на конпку CodePen, щоб побачити анімацію в середовищі CodePen)

- -

{{EmbedLiveSample("Adding_another_keyframe","100%","250")}}

- -

Making it repeat

- -

Якщо вам потрібно, аби анімація повторювалась, просто використайте властивість  {{ cssxref("animation-iteration-count") }} , щоб зазначити, скільки разів повинна повторитися анімація. В даному випадку давайте використаємо значення infinite для отримання постійної анімації:

- -
p {
-  animation-duration: 3s;
-  animation-name: slidein;
-  animation-iteration-count: infinite;
-}
-
- - - - - -

{{EmbedLiveSample("Making_it_repeat","100%","250")}}

- -

Змінюємо напрямки анімації

- -

Отже, анімація повторювана, але це виглядає дивно: текст по завершенню циклу, з початком нового знову стрибає вбік. Отже нам треба зробити, аби текст плавно повертався назад, на початкову позицію. Це просто: прописуємо у {{ cssxref("animation-direction") }} значення alternate:

- -
p {
-  animation-duration: 3s;
-  animation-name: slidein;
-  animation-iteration-count: infinite;
-  animation-direction: alternate;
-}
-
- - - - - -

{{EmbedLiveSample("Making_it_move_back_and_forth","100%","250")}}

- -

Використання скорочень для правил анімації

- -

{{ cssxref("animation") }} скорочення є вигідним для економії місця. От, для прикладу, правила анімації, які ми вже використали в статті:

- -
p {
-  animation-duration: 3s;
-  animation-name: slidein;
-  animation-iteration-count: infinite;
-  animation-direction: alternate;
-}
-
- -

Їх можна замінити ось таким чином

- -
p {
-  animation: 3s infinite alternate slideIn;
-}
- -
-

Примітка: Ви можете дізнатися про це більше на сторінці довідки {{ cssxref("animation") }} :

-
- -

Задання множинних значень властивостей анімації

- -

Нескорочені значення CSS анімації можуть приймати множинні значення, розділені комами — таку особливість можна використати, якщо вам потрібно задати множинні анімації єдиним набором правил і відповідно задати різні тривалості, повтори і так далі для різних анімацій. Давайте глянемо на кілька швидких прикладів, аби пояснити різні зміни:

- -

В першому прикладі у нас є набір з трьох різних імен анімації, але одна й та ж тривалість і кількість повторів:

- -
animation-name: fadeInOut, moveLeft300px, bounce;
-animation-duration: 3s;
-animation-iteration-count: 1;
- -

В другому прикладі в нас є набір з 3х значень для кожної властивості. В цьому випадку кожна анімація буде здійснюватися з відповідними значеннями, згідно з їх розміщенням у властивостях, то ж, приміром, fadeInOut має тривалість в 2.5s і кількість повторів 2,  і т.д..

- -
animation-name: fadeInOut, moveLeft300px, bounce;
-animation-duration: 2.5s, 5s, 1s;
-animation-iteration-count: 2, 1, 5;
- -

У цьому третьому випадку є три різні анімації, але лише дві різні тривалості та кількості повторів. У таких випадках наборів значень недостатньо, то ж кожна анімація отримає свій набір значень шляхом перебору від початку до кінця. Наприклад, fadeInOut отримає тривалість в 2.5s і moveLeft300px матиме тривалість 5s. Набори значень на цьому закінчились, тому все починається з початку і третя анімація bounce отримає тривалість знову в 2.5s. Кількість повторів (та й будь-які інші значення властивостей, які ви задасте) будуть присвоєні такими самим чином.

- -
animation-name: fadeInOut, moveLeft300px, bounce;
-animation-duration: 2.5s, 5s;
-animation-iteration-count: 2, 1;
- -

Використання подій анімації

- -

Ви можете отримати додатковий контроль над анімаціями, як і корисну інформацію про них шляхом використання подій анімації. Ці події, представлені об'єктом {{ domxref("AnimationEvent") }}, можуть бути використані, аби визначити, коли починаються, закінчуються і починають новий повтор різні анімації. Кожна подія містить час, о котрій вона сталась та ім'я анімації, яка її запустила.

- -

Зараз ми змінимо приклад з ковзаючим текстом, аби вивести певну інформацію про кожну анімаційну подію, тобто її час, то ж ми можемо розібратися, як вони працюють.

- -

Додавання CSS

- -

Починаємо зі створення CSS для анімації. Дана анімація триватиме 3 секунди, назвемо її “slidein”, задамо повтор 3 рази, і напрям анімації alternate кожного разу. В {{ cssxref("@keyframes") }}, ширина і лівий маргін змінюються, щоб текст ковзав по екрану.

- -
.slidein {
-  animation-duration: 3s;
-  animation-name: slidein;
-  animation-iteration-count: 3;
-  animation-direction: alternate;
-}
-
-@keyframes slidein {
-  from {
-    margin-left:100%;
-    width:300%
-  }
-
-  to {
-    margin-left:0%;
-    width:100%;
-  }
-}
- -

Встановлення animation event listeners - прослуховування подій анімації

- -

Ми використаємо код JavaScript для прослуховування всіх трьох можливих подій анімації. Даний код задає наші event listeners; ми викликаємо його, коли документ вперше завантажений, для того, щоб отримати впорядковані дані.

- -
var e = document.getElementById("watchme");
-e.addEventListener("animationstart", listener, false);
-e.addEventListener("animationend", listener, false);
-e.addEventListener("animationiteration", listener, false);
-
-e.className = "slidein";
-
- -

Це цілком звичайний код, аби дізнатися більше, ви можете звіритися з документацією {{ domxref("eventTarget.addEventListener()") }}. Останнє, що робить код - він задає клас анімованого елемента як “slidein”; це нам потрібно для запуску анімації.

- -

Чому? Тому що подія animationstart запускається одразу ж, як стартує анімація; в даному випадку це стається до того, як починає діяти наш код. То ж ми починаємо анімацію самі, задаючи клас елементу для стиля, котрий буде анімований по факту.

- -

Отримання подій

- -

Події надсилаються до функції listener(), як це показано нижче.

- -
function listener(e) {
-  var l = document.createElement("li");
-  switch(e.type) {
-    case "animationstart":
-      l.innerHTML = "Started: elapsed time is " + e.elapsedTime;
-      break;
-    case "animationend":
-      l.innerHTML = "Ended: elapsed time is " + e.elapsedTime;
-      break;
-    case "animationiteration":
-      l.innerHTML = "New loop started at time " + e.elapsedTime;
-      break;
-  }
-  document.getElementById("output").appendChild(l);
-}
-
- -

Даний код також дуже простий. Він просто дивиться в {{ domxref("event.type") }}, аби визначити, який власне тип події анімації трапився, тоді додає відповідну примітку в {{ HTMLElement("ul") }} (невпорядкований список), який ми використовуємо для виводу звіту про ці події.

- -

Звіт після завершення роботи буде виглядати якось от так:

- - - -

Зауважте, що часи подій досить точні щодо тих, які ми очікували відповідно до таймінгу, який ми задали, коли створювали анімацію. Візьміть до уваги також і те, що після завершального проходу анімації подія animationiteration не була надіслана; натомість надіслало подію animationend.

- -

HTML

- -

Чисто для повної завершеності огляду ось код, який відображає контент сторіки, включно зі списком звіту про події анімації, який створився завдяки вищеописаному скрипту:

- -
<h1 id="watchme">Watch me move</h1>
-<p>
-  This example shows how to use CSS animations to make <code>H1</code>
-  elements move across the page.
-</p>
-<p>
-  In addition, we output some text each time an animation event fires,
-  so you can see them in action.
-</p>
-<ul id="output">
-</ul>
-</body>
-
- -

{{EmbedLiveSample('Using_animation_events', '600', '300')}}

- -

Дивіться також

- - diff --git a/files/uk/web/css/css_box_model/index.html b/files/uk/web/css/css_box_model/index.html deleted file mode 100644 index 5bd889607a..0000000000 --- a/files/uk/web/css/css_box_model/index.html +++ /dev/null @@ -1,162 +0,0 @@ ---- -title: Коробчаста модель CSS -slug: Web/CSS/CSS_Box_Model -tags: - - CSS - - Довідка - - Коробчаста модель CSS -translation_of: Web/CSS/CSS_Box_Model -original_slug: Web/CSS/Коробчаста_модель_CSS ---- -
Коробчаста модель (box model) — це алгоритм CSS, що подає елементи (включно з їх {{cssxref("margin", "відступами")}} та {{cssxref("padding", "полями")}}) у вигляді прямокутних «коробок» та компонує їх відповідно до {{cssxref("Visual_formatting_model", "моделі візуального формування")}}.
- -

Довідка

- -

Властивості

- -

Властивості, що визначають потік (flow) вмісту

- -
- -
- -

Властивості, що визначають розміри

- -
- -
- -

Властивості, що визначають відступи

- -
- -
- -

Властивості, що визначають поля

- -
- -
- -

Інші властивості

- -
- -
- -

Посібники

- -
-
Вступ до коробчастої моделі CSS
-
Описує та пояснює одне з ґрунтовних понять в CSS — коробчасту модель. Ця модель визначає, як CSS розташовує елементи, їх вміст, {{cssxref("padding", "поля")}}, {{cssxref("border", "обрамок")}} та {{cssxref("margin", "відступи")}}.
-
Згортання відступів
-
Два прилеглі відступи інколи згортаються в один. Ця стаття наводить правила, за якими це відбувається, та пояснює, як цим керувати.
-
Модель візуального формування
-
Описує та пояснює модель візуального формування.
-
- -

Специфікації

- - - - - - - - - - - - - - - - - - - - - - - - - - -
СпецифікаціяСтатусКоментар
{{SpecName("CSS3 Box")}}{{Spec2("CSS3 Box")}} 
{{SpecName("CSS2.1", "box.html")}}{{Spec2("CSS2.1")}} 
{{SpecName("CSS1")}}{{Spec2("CSS1")}}Первинне визначення
- -

Підтримка веб-переглядачами

- -

{{CompatibilityTable}}

- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support1.0{{CompatGeckoDesktop("1")}}3.03.51.0 (85)
-
- -
- - - - - - - - - - - - - - - - - - - -
FeatureAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support1.0{{CompatGeckoMobile("1")}}6.06.01.0
-
diff --git a/files/uk/web/css/css_box_model/mastering_margin_collapsing/index.html b/files/uk/web/css/css_box_model/mastering_margin_collapsing/index.html deleted file mode 100644 index 44a6f7b56b..0000000000 --- a/files/uk/web/css/css_box_model/mastering_margin_collapsing/index.html +++ /dev/null @@ -1,91 +0,0 @@ ---- -title: Згортання відступів -slug: Web/CSS/CSS_Box_Model/Mastering_margin_collapsing -tags: - - CSS - - Коробчаста модель CSS - - Посібник -translation_of: Web/CSS/CSS_Box_Model/Mastering_margin_collapsing -original_slug: Web/CSS/CSS_Box_Model/Згортання_відступів ---- -
{{CSSRef}}
- -

The top and bottom margins of blocks are sometimes combined (collapsed) into a single margin whose size is the largest of the individual margins (or just one of them, if they are equal), a behavior known as margin collapsing. Note that the margins of floating and absolutely positioned elements never collapse.

- -

Margin collapsing occurs in three basic cases:

- -
-
Безпосередні (прилеглі) сусіди
-
The margins of adjacent siblings are collapsed (except when the latter sibling needs to be cleared past floats).
-
Батько та перший/останній дочірній елемент
-
If there is no border, padding, inline part, {{cssxref("Block_formatting_context")}} created, or clearance to separate the {{cssxref("margin-top")}} of a block from the {{cssxref("margin-top")}} of its first child block; or no border, padding, inline content, {{cssxref("height")}}, {{cssxref("min-height")}}, or {{cssxref("max-height")}} to separate the {{cssxref("margin-bottom")}} of a block from the {{cssxref("margin-bottom")}} of its last child, then those margins collapse. The collapsed margin ends up outside the parent.
-
- -
-
Порожні блоки
-
If there is no border, padding, inline content, {{cssxref("height")}}, or {{cssxref("min-height")}} to separate a block's {{cssxref("margin-top")}} from its {{cssxref("margin-bottom")}}, then its top and bottom margins collapse.
-
- -

More complex margin collapsing (of more than two margins) occurs when these cases are combined.

- -

These rules apply even to margins that are zero, so the margin of a first/last child ends up outside its parent (according to the rules above) whether or not the parent's margin is zero.

- -

When negative margins are involved, the size of the collapsed margin is the sum of the largest positive margin and the smallest (most negative) negative margin.

- -

When all margins are negative, the size of the collapsed margin is the smallest (most negative) margin. This applies to both adjacent elements and nested elements.

- -

Приклади

- -

HTML

- -
<p>The bottom margin of this paragraph is collapsed...</p>
-<p>...with the top margin of this paragraph, yielding a margin of <code>1.2rem</code> in between.</p>
-
-<div>This parent element contains two paragraphs!
-  <p>This paragraph has a <code>.4rem</code> margin between it and the text above.</p>
-  <p>My bottom margin collapses with my parent, yielding a bottom margin of <code>2rem</code>.</p>
-</div>
-
-<p>Blah blah blah.</p>
- -

CSS

- -
div {
-  margin: 2rem 0;
-  background: lavender;
-}
-
-p {
-  margin: .4rem 0 1.2rem 0;
-  background: yellow;
-}
- -

Результат

- -

{{EmbedLiveSample('Examples','100%',250)}}

- -

Специфікації

- - - - - - - - - - - - - - - - -
СпецифікаціяСтатусКоментар
{{SpecName("CSS2.1", "box.html#collapsing-margins", "margin collapsing")}}{{Spec2("CSS2.1")}}Первинне визначення
- -

Див. також

- - diff --git a/files/uk/web/css/css_flexible_box_layout/basic_concepts_of_flexbox/index.html b/files/uk/web/css/css_flexible_box_layout/basic_concepts_of_flexbox/index.html deleted file mode 100644 index bbd3d8d5e4..0000000000 --- a/files/uk/web/css/css_flexible_box_layout/basic_concepts_of_flexbox/index.html +++ /dev/null @@ -1,392 +0,0 @@ ---- -title: Використання CSS flexible-боксів -slug: Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox -translation_of: Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox -translation_of_original: Web/CSS/CSS_Flexible_Box_Layout/Using_CSS_flexible_boxes -original_slug: Web/CSS/CSS_Flexible_Box_Layout/Using_CSS_flexible_boxes ---- -
{{CSSRef}}
- -

CSS3 flex-бокс, або flexbox, це режим розмітки створений для упорядкування елементів на сторінці таким чином, щоб вони поводилися передбачувано у випадках, коли розмітка сторінки адаптована під різні розміри екрану і різні девайси.  В багатьох випадках flexible box є вдосконаленням блокової моделі розмітки, яка не використовує обтікання (floats) і не виконує схлопування відступів flex контейнера і  його контенту (margins collapse).

- -

Для багатьох дизайнерів модель використання flex-боксів буде більш простою для застосування. Дочірні елементи всередині flex-боксу можуть розміщуватись у будь-якому напрямку і можуть мати змінні виміри щоб адаптовуватись до різних розмірів дисплею. Позиціонування елементів у такому разі є простішим і комплексна розмітка досягається значно легше і з чистішим кодом, оскільки порядок відображення елементів не пов'язаний із їх порядком в коді. Ця незалежність навмисне стосується лише візуального рендерингу, залишаючи порядок інтерпритації і навігацію залежними від порядку у сорсі.

- -
Увага: Де-які броузери все ще можуть частково або повністю не підтримувати flex боксів. Ознайомтесь із  таблицею сумісності для flex боксів
- -

Концепція flex-боксів

- -

Головною концепцією flex-боксів є можливість зміни висоти та/або ширини його елементів шоб найкраше заповнювати простір будь-якого дисплею. Flex-контейнер збільшує елементи, щоб заповнити доступний простір чи зменшує щоб запобігти перекриванню.

- -

Алгоритм розмітки flex-боксами є напрямно-агностичним на противагу блоковій розмітці, яка вертикально-орієнтована, чи горизонтально-орієнтованій інлайн-розмітці. Не зважаючи на те що розмітка блоками добре підходить для сторінки, їй не вистачає об'єктивного механізму для підтримки компонентів, що повинні змінювати орієнтацію, розміри а також розтягуватись чи стискатись при змінах юзер-агента, змінах з вертикальної на горизонтальну орієнтацію і таке інше. Розмітка flex-боксами найбільш бажана для компонентів додатку і шаблонів, що мало масштабуються, тоді як grid-розмітка створена для великих шаблонів, що масштабуються. Обидві технології є частиною розробки CSS Working Group яка має сприяти сумісності web-аплікацій з різними юзер-агентами, режимами а також більшій гнучкості.

- -

Словник Flexible box термінів  

- -

Оскільки опис flexible-боксів не включає таких словосполучень, як горизонтальна/інлайн і вертикальна/блокова осі, пояснення моделі передбачає нову термінологію. Використовуйте наступну діаграму під час перегляду словника термінів. Вона зображає flex-контейнер, що має  flex-напрямок ряду, що означає, що кожен flex item розміщений горизонтально, один за одним по головній осі (main axis) відповідно до встановленного режиму написання, напрямку тексту елементу. Зліва-направо у данному випадку.

- -

flex_terms.png

- -
-
Flex-контейнер
-
Батьківський елемент, у якому містяться flex-айтеми. Flex-контейнер визначається flex або inline-flex значеннями {{Cssxref("display")}} властивості.
-
Flex-айтем
-
-

Кожен дочірній елемент flex-контейнеру стає flex-айтемом. Текст, що напряму міститься в flex-контейнері обгортається анонімним flex-айтемом.

-
-
Осі
-
-

Кожен flexible-бокс шаблон будується по двох осях. Головна вісь (main axis) - вісь, вздовж якої flex-айтеми слідують один за одним. Перехресна вісь (cross axis) вісь, що перпендикулярна до main axis.

- -
    -
  • Властивість flex-direction встановлює main axis.
  • -
  • Властивість justify-content визначає як flex-айтеми розташовані вздовж main axis на поточній лінії.
  • -
  • Властивість align-items визначає замовчування для розташування flex-айтемів вздовж cross axis на поточній лінії.
  • -
  • Властивість align-self встановлює, як кожен окремий flex-айтем вирівняний по cross axis і переписує замовчування, встановлене за допомогою align-items.
  • -
-
-
Напрямки
-
-

Головний початок/головний кінець(main start/main end) і перехресний початок/перехресний кінець(cross start/cross end) це сторони flex-контейнера, що визначають початок і закінчення потоку flex-айтемів. Вони слідують за головною і перехресною осями flex-контейнера у векторі, встановленому режимом написання (зліва-направо, зправа-наліво і т.д.).

- -
    -
  • Властивість order присвоює елементи порядковим групам і визначає, який елемент є першим.
  • -
  • Властивість flex-flow це скорочена форма для flex-direction та flex-wrap властивостей.
  • -
-
-
Лінії
-
-

Flex-айтеми можуть бути розміщені на одній чи кількох лініях відповідно до flex-wrap властивості, яка контролює напрямок перехресних ліній і напрямок у якому складаються нові лінії.

-
-
Виміри
-
Еквівалентами для height і width для flex-айтемів є main size та cross size, які відповідно стосуються main axis і cross axis flex-контейнера.
-
-
    -
  • Початковим значенням для min-height і min-width є 0.
  • -
  • Властивість flex виступає скороченням для flex-grow, flex-shrink, а також flex-basis властивостей для встановлення гнучкості flex-айтема.
  • -
-
-
- -

Робимо елемент flexible-боксом

- -

Щоб зробити елемент flexible-боксом, вкажіт занчення display властивості наступним чином:

- -
display : flex
- -

або

- -
display : inline-flex
- -

Роблячи таким чином, ми визначаєм елемент як flexible-бокс, а його нащадків- як flexible-айтеми. Значення flex робить контейнер блоковим елементом. А inline-flex значення перетворює його на інлайн-елемент.

- -
Увага: Для вказання префіксу вендора, додайте рядок до значення атрибуту, а не до самого атрибуту. Наприклад, display : -webkit-flex.
- -

Характеристики flex-айтема

- -

Текст, що напряму поміщений до flex-контейнера автоматично обгортається в анонімний flex-айтем. Тим не менше анонімний flex-айтем, що містить лише пробільні симфоли не рендериться, так ніби йому було встановлене правило display: none.

- -

Абсолютно-позиціоновані дочірні елементи flex-контейнера позиціонуються так, що іхня статична позиція визначається відносно головного стартового кута контент-боксу їхнього flex-контейнера.

- -

У сусідніх flex-айтемів марджіни не накладаються один на інший. Використовуючи auto марджіни можна поглинути зайві відстані у вертикальному чи горизонтальному напрямках тим самим досягнувши вирівнювання чи розмежування сусідніх flex-айтемів.  Для детальної інформації прочитайте  вирівнювання з допомогою 'auto' марджінів у W3C специфікації "модель Flexible-бокс розмітки" (англ.).

- -

Для забезпечення адекватного замовчування мінімальних розмірів flex-айтема, використовуйте min-width:auto і/або min-height:auto. Для flex-айтемів, значення атрибуту auto вираховує мінімальну ширину/висоту айтема щоб не були меншими за ширину/висоту їхнього контенту, гарантуючи, що айтем відрендерений достатньо великим, для того, щоб вмістити контент. Дивіться {{cssxref("min-width")}} і {{cssxref("min-height")}} для більш детальної інформації.

- -

Атрибути вирівнювання flex-боксів виконують справжнє центрування, на відміну від інших методів центрування у CSS. Це означає, що flex-айтеми залишаться відцентрованими навіть коли вони виходять за межі flex-контейнера. Хоча така ситуація де-коли можи бути проблемою, оскільки якщо вони виходять за межі верхнього чи лівого (для LTR мов , таких, як англійська чи українська; проблема актуальна для правого краю для RTL мов, таких, як арабська) країв сторінки, вам не вдасться проскролити до цієї частини, не зважаючи на те, що там є контент! В майбутньому релізі властивості вирівнювання мають бути розширені для підтримаки безпечного режиму також. Зараз, якщо це проблема, Ви можете використовувати відступи (margin), щоб досягнути центрування.

- -

For now, if this is a concern, you can instead use margins to achieve centering, as they'll respond in a "safe" way and stop centering if they overflow. Instead of using the align- properties, just put auto margins on the flex items you wish to center. Instead of the justify- properties, put auto margins on the outside edges of the first and last flex items in the flex container. The auto margins will "flex" and assume the leftover space, centering the flex items when there is leftover space, and switching to normal alignment when not. However, if you're trying to replace justify-content with margin-based centering in a multi-line flexbox, you're probably out of luck, as you need to put the margins on the first and last flex item on each line. Unless you can predict ahead of time which items will end up on which line, you can't reliably use margin-based centering in the main axis to replace the justify-content property.

- -

Recall that while the display order of the elements is independent of their order in the source code, this independence affects only the visual rendering, leaving speech order and navigation based on the source order. Even the {{cssxref("order")}} property does not affect speech or navigation sequence. Thus developers must take care to order elements properly in the source so as not to damage the document's accessibility.

- -

Flexible box properties

- -

Properties not affecting flexible boxes

- -

Because flexible boxes use a different layout algorithm, some properties do not make sense on a flex container:

- - - -

Examples

- -

Basic flex example

- -

This basic example shows how to apply "flexibility" to an element and how sibling elements behave in a flexible state.

- -
​<!DOCTYPE html>
-<html lang="en">
-  <head>
-    <style>
-
-   .flex
-   {
-      /* basic styling */
-      width: 350px;
-      height: 200px;
-      border: 1px solid #555;
-      font: 14px Arial;
-
-      /* flexbox setup */
-      display: -webkit-flex;
-      -webkit-flex-direction: row;
-
-      display: flex;
-      flex-direction: row;
-   }
-
-   .flex > div
-   {
-      -webkit-flex: 1 1 auto;
-      flex: 1 1 auto;
-
-      width: 30px; /* To make the transition work nicely.  (Transitions to/from
-                      "width:auto" are buggy in Gecko and Webkit, at least.
-                      See http://bugzil.la/731886 for more info.) */
-
-      -webkit-transition: width 0.7s ease-out;
-      transition: width 0.7s ease-out;
-   }
-
-   /* colors */
-   .flex > div:nth-child(1){ background : #009246; }
-   .flex > div:nth-child(2){ background : #F1F2F1; }
-   .flex > div:nth-child(3){ background : #CE2B37; }
-
-   .flex > div:hover
-   {
-        width: 200px;
-   }
-
-   </style>
-
- </head>
- <body>
-  <p>Flexbox nuovo</p>
-  <div class="flex">
-    <div>uno</div>
-    <div>due</div>
-    <div>tre</div>
-  </div>
- </body>
-</html>
- -

Holy Grail Layout example

- -

This example demonstrates how flexbox provides the ability to dynamically change the layout for different screen resolutions. The following diagram illustrates the transformation.

- -

HolyGrailLayout.png

- -

Illustrated here is the case where the page layout suited to a browser window must be optimized for a smart phone window. Not only must the elements reduce in size, but the order in which they are presented must change. Flexbox makes this very simple.

- -
​<!DOCTYPE html>
-<html lang="en">
-  <head>
-    <style>
-
-  body {
-   font: 24px Helvetica;
-   background: #999999;
-  }
-
-  #main {
-   min-height: 800px;
-   margin: 0px;
-   padding: 0px;
-   display: -webkit-flex;
-   display:         flex;
-   -webkit-flex-flow: row;
-           flex-flow: row;
-   }
-
-  #main > article {
-   margin: 4px;
-   padding: 5px;
-   border: 1px solid #cccc33;
-   border-radius: 7pt;
-   background: #dddd88;
-   -webkit-flex: 3 1 60%;
-           flex: 3 1 60%;
-   -webkit-order: 2;
-           order: 2;
-   }
-
-  #main > nav {
-   margin: 4px;
-   padding: 5px;
-   border: 1px solid #8888bb;
-   border-radius: 7pt;
-   background: #ccccff;
-   -webkit-flex: 1 6 20%;
-           flex: 1 6 20%;
-   -webkit-order: 1;
-           order: 1;
-   }
-
-  #main > aside {
-   margin: 4px;
-   padding: 5px;
-   border: 1px solid #8888bb;
-   border-radius: 7pt;
-   background: #ccccff;
-   -webkit-flex: 1 6 20%;
-           flex: 1 6 20%;
-   -webkit-order: 3;
-           order: 3;
-   }
-
-  header, footer {
-   display: block;
-   margin: 4px;
-   padding: 5px;
-   min-height: 100px;
-   border: 1px solid #eebb55;
-   border-radius: 7pt;
-   background: #ffeebb;
-   }
-
-  /* Too narrow to support three columns */
-  @media all and (max-width: 640px) {
-
-   #main, #page {
-    -webkit-flex-flow: column;
-            flex-direction: column;
-   }
-
-   #main > article, #main > nav, #main > aside {
-    /* Return them to document order */
-    -webkit-order: 0;
-            order: 0;
-   }
-
-   #main > nav, #main > aside, header, footer {
-    min-height: 50px;
-    max-height: 50px;
-   }
-  }
-
- </style>
-  </head>
-  <body>
- <header>header</header>
- <div id='main'>
-    <article>article</article>
-    <nav>nav</nav>
-    <aside>aside</aside>
- </div>
- <footer>footer</footer>
-  </body>
-</html>
- -

Playground

- -

There are a few flexbox playgrounds available online for experimenting:

- - - -

Things to keep in mind

- -

The algorithm describing how flex items are laid out can be pretty tricky at times. Here are a few things to consider to avoid bad surprises when designing using flexible boxes.

- -

Flexible boxes are laid out in conformance of the writing mode, which means that main start and main end are laid out according to the position of start and end.

- -

cross start and cross end rely on the definition of the start or before position that depends on the value of direction.

- -

Page breaks are possible in flexible boxes layout as long as break- property allows it. CSS3 break-after, break-before, and break-inside as well as CSS 2.1 page-break-before, page-break-after, and page-break-inside properties are accepted on a flex container, flex items, and inside flex items.

- -

Browser compatibility

- -

{{CompatibilityTable}}

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureFirefox (Gecko)ChromeInternet ExplorerOperaSafari
Basic support (single-line flexbox){{CompatGeckoDesktop("18.0")}}[6]{{property_prefix("-moz")}}[2]
- {{CompatGeckoDesktop("22.0")}}
21.0{{property_prefix("-webkit")}}
- 29.0
11[3]12.10{{property_prefix("-webkit")}}[5]6.1{{property_prefix("-webkit")}}[1]
Multi-line flexbox{{CompatGeckoDesktop("28.0")}}21.0{{property_prefix("-webkit")}}
- 29.0
11[3]12.10[5]
- 15 {{property_prefix("-webkit")}}
6.1{{property_prefix("-webkit")}}[1]
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureFirefox Mobile (Gecko)Firefox OSAndroidIE PhoneOpera MobileSafari Mobile
Basic support (single-line flexbox){{CompatGeckoMobile("18.0")}}{{property_prefix("-moz")}}[2]
- {{CompatGeckoMobile("22.0")}}
-

1.0{{property_prefix("-moz")}}[2]
- 1.1

-
2.1{{property_prefix("-webkit")}}[4]
- 4.4
1112.10[5]
- 15{{property_prefix("-webkit")}}
7{{property_prefix("-webkit")}}[1]
Multi-line flexbox{{CompatGeckoMobile("28.0")}}1.32.1{{property_prefix("-webkit")}}[4]
- 4.4
1112.10[5]
- 15{{property_prefix("-webkit")}}
7{{property_prefix("-webkit")}}[1]
-
- -

[1] Safari up to version  6.0 (iOS.1) supported an old incompatible draft version of the specification. Safari 6.1 (and Safari on iOS 7) has been updated to support the final version.

- -

[2] Up to Firefox 22, to activate flexbox support, the user has to change the about:config preference layout.css.flexbox.enabled to true. From Firefox 22 to Firefox 27, the preference is true by default, but the preference has been removed in Firefox 28.

- -

[3] Internet Explorer 10 supports an old incompatible draft version of the specification; Internet Explorer 11 has been updated to support the final version.

- -

[4] Android browser up to 4.3 supported an old incompatible draft version of the specification. Android 4.4 has been updated to support the final version.

- -

[5] While in the initial implementation in Opera 12.10 flexbox was not prefixed, it got prefixed in versions 15 to 16 of Opera and 15 to 19 of Opera Mobile with {{property_prefix("-webkit")}}. The prefix was removed again in Opera 17 and Opera Mobile 24.

- -

[6] Up to Firefox 29, specifying visibility: collapse on a flex item causes it to be treated as if it were display: none instead of the intended behavior, treating it as if it were visibility: hidden. The suggested workaround is to use visibility:hidden for flex items that should behave as if they were designated visibility:collapse. For more information, see {{bug(783470)}}

diff --git a/files/uk/web/css/css_flexible_box_layout/index.html b/files/uk/web/css/css_flexible_box_layout/index.html deleted file mode 100644 index 3520d3040d..0000000000 --- a/files/uk/web/css/css_flexible_box_layout/index.html +++ /dev/null @@ -1,132 +0,0 @@ ---- -title: CSS Flexible Box Layout -slug: Web/CSS/CSS_Flexible_Box_Layout -tags: - - CSS - - CSS Flexible Boxes - - CSS Reference - - NeedsTranslation - - Overview - - TopicStub -translation_of: Web/CSS/CSS_Flexible_Box_Layout ---- -

{{CSSRef}}

- -

CSS Flexible Box Layout це модуль CSS що реалізує можливість розмітки макета за допомогою оптимізованої коробочної моделі, що використовується для створення дизайну інтерфейса користувача, та проводити вирівнювання елементів в одному із вимірів. В цій моделі (flex layout), потомки flex контейнера можуть бути розміщені відносно будь якої осі, і можуть "гнучко" змінювати свій розмір, можуть рости, щоб зайняти весь відведений простір або зменшуватись щоб не переповнити своїми поточними розмірами контейнер, що їх містить. Наявне і горизонтальне і вертикальне вирівнювання потомків, і до того-ж проводити будь-які маніпуляції дуже легко.

- -

 

- -

 

- -

Простий Приклад

- -

В наступному прикладі у контейнерa встановлено властивість display: flex, що означає - три його вкладені елементи є  flex елементами. Значення justify-content має значення space-between для того щоб порожній простір між елементами рівномірно розподілився по головній осі. Однаковий простір буде виділений між кожним елементом, але при цьому крайні елементи(перший та останній) не будуть мати  справа та зліва відповідно відступів від контейнера. Ви можете бачити що елементи будуть розподілені по поточній направляючій вісі, бо на це впливають виставлені по замовчуванню значення властивості align-items рівний stretch. Елементи розтягуються по висоті flex контейнера, і кожен стане такої висоти як самий вищий елемент.

- -

{{EmbedGHLiveSample("css-examples/flexbox/basics/simple-example.html", '100%', 500)}}

- -

Reference

- -

 

- -

Reference

- -

CSS Properties

- -
- -
- -

Guides

- -
-
Using CSS flexible boxes
-
Step-by-step tutorial about how to build layouts using this feature.
-
Using flexbox to lay out Web applications
-
Tutorial explaining how to use flexbox in the specific context of Web applications.
-
- -

Specifications

- - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{ SpecName('CSS3 Flexbox') }}{{ Spec2('CSS3 Flexbox') }}Initial definition.
- -

Browser compatibility

- -

{{CompatibilityTable()}}

- -
- - - - - - - - - - - - - - - - - - - -
FeatureFirefox (Gecko)ChromeInternet ExplorerOperaSafari
Basic support{{CompatGeckoDesktop("20.0")}}21.0{{property_prefix("-webkit")}}
- 29.0
10.0{{property_prefix("-ms")}}
- 11.0
12.106.1{{property_prefix("-webkit")}}
-
- -
- - - - - - - - - - - - - - - - - - - -
FeatureFirefox Mobile (Gecko)AndroidIE PhoneOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown()}}4.41112.107.1{{property_prefix("-webkit")}}
-
- -

 

diff --git a/files/uk/web/css/css_grid_layout/basic_concepts_of_grid_layout/index.html b/files/uk/web/css/css_grid_layout/basic_concepts_of_grid_layout/index.html deleted file mode 100644 index 84c95201bb..0000000000 --- a/files/uk/web/css/css_grid_layout/basic_concepts_of_grid_layout/index.html +++ /dev/null @@ -1,699 +0,0 @@ ---- -title: Основна концепція макета grid -slug: Web/CSS/CSS_Grid_Layout/Basic_Concepts_of_Grid_Layout -tags: - - CSS Grid - - Посібник -translation_of: Web/CSS/CSS_Grid_Layout/Basic_Concepts_of_Grid_Layout ---- -

CSS Grid Layout вводить двовимірну сітку до CSS. Сітки можуть бути використані для виділення основних областей сторінки або невеликих елементів інтерфейсу користувача. У цій статті надана схема CSS Grid Layout та нова термінологія, що є частиною специфікації CSS Grid Layout Level 1. Функції, наведені в цьому огляді, будуть більш детально пояснені далі в цьому посібнику.

- -

Що таке grid?

- -

Grid є перехресним набором  горизонтальних і вертикальних ліній, що перетинаються - один набір визначає стовпці,  інший рядки. Елементи можуть бути розміщені на сітці, дотримуючись цих стовпців та рядків. Макет сітки CSS має такі особливості:

- -

Фіксовані та гнучкі розміри смуг

- -

Ви можете створити сітку з фіксованими розмірами смуг – наприклад, використовуючи пікселі. Це встановлює сітку на певні пікселі, що відповідають бажаному макету. Ви також можете створити сітку з використанням гнучких розмірів у відсотках або з новою одиницею fr, яку розроблену саме для цієї мети.

- -

Розміщення елементів

- -

Ви можете розміщувати елементи у точному місці сітки, використовуючи номери рядків, імена або орієнтуючись на область сітки. Сітка також містить алгоритм для контролю розміщення елементів, які не мають явного положення на сітці.

- -

Створення додаткових смуг для вмісту

- -

Ви можете визначати сітку явно в макеті сітки, але специфікація також стосується вмісту, доданого за межами оголошеної сітки, додаючи додаткові рядки та стовпчики за потребою. Спрацьовує принцип додавання " стільки стовпчиків, скільки вміститься в контейнер".

- -

Управління вирівнюванням

- -

Сітка містить функції вирівнювання для того, щоб ми могли контролювати, як вирівнюються розміщені в області сітки елементи  та як вирівнюється вся Grid-сітка.

- -

Управління вмістом, що перекривається

- -

У секцію сітки можна додати більш ніж один елемент. Також області можуть частково перекривати одна одну. Цим накладенням можна керувати за допомогою {{cssxref("z-index")}} властивості.

- -

Grid - це потужна специфікація, яка у поєднанні з іншими можливостями CSS такими, як flexbox, дозволяє вам створювати макети, які раніше неможливо було створити за допомогою CSS. Все починається шляхом створення сітки у grid-контейнері.

- -

Grid-контейнер

- -

Ми створюємо grid-контейнер оголошуючи display: grid або display: inline-grid на елементі. Як тільки ми це зробимо, всі прямі діти елементу стають grid-елементами.

- -

У цьому прикладі, у мене div-елемент з класом wrapper, що містить в собі п'ять дочірніх елементів.

- -
<div class="wrapper">
-  <div>One</div>
-  <div>Two</div>
-  <div>Three</div>
-  <div>Four</div>
-  <div>Five</div>
-</div>
-
- -

Я роблю з класу .wrapper grid-контейнер.

- -
.wrapper {
-  display: grid;
-}
-
- - - -

{{ EmbedLiveSample('The_Grid_container', '200', '330') }}

- -

Всі прямі нащадки тепер є grid-елементами. В браузері ви не помітите ніякої різниці між виглядом елементів до і після створення grid-контейнеру. З цієї точки зору вам буде корисно працювати в редакторі Firefox Developer Edition, який має Grid Inspector, доступний як частина інструментів розробника. Якщо ви розглянете цей приклад в  Firefox і перевірите grid, ви побачите маленький значок біля значення grid. Клікніть його і сітка накладеться на цей елемент у вікні браузера.

- -

Using the Grid Highlighter in DevTools to view a grid

- -

Як вийде - працюйте з  CSS Grid Layout, це інструмент надасть вам краще розуміння того що відбувається з вашою grid-сіткою візуально. 

- -

Якщо ми хочемо щоб це було більше grid-орієнтовано, треба додавати більше смуг-стовбців.

- -

Grid Смуги

- -

Ми визначаємо рядки і стовпчики на нашій grid-сітці  властивостями {{cssxref("grid-template-columns")}} та {{cssxref("grid-template-rows")}}. Вони визначають grid смуги. Grid-смуга – це простір будь якими двома лініями на grid-сітці. На зображенні нижче кольорова смуга – перша смуга-рядок на нашій grid-сітці.

- -

- -

До попереднього прикладу можна додати властивість  grid-template-columns, визначаючи розмір смуг-стовпчиків.

- -

Таким чином створено grid-сітку з трьома смугами-стовпчиками шириною по 200 рх. Дочірні елементи вкладатимуться в цю grid-сітку в кожну клітинку. 

- -
-
<div class="wrapper">
-  <div>One</div>
-  <div>Two</div>
-  <div>Three</div>
-  <div>Four</div>
-  <div>Five</div>
-</div>
-
- -
.wrapper {
-  display: grid;
-  grid-template-columns: 200px 200px 200px;
-}
-
- - - -

{{ EmbedLiveSample('grid_first', '610', '140') }}

-
- -

Одиниця fr 

- -

Смуги визначаються одиницями довжини. Grid-сітка має додаткову одиницю довжини яка допомагає створювати гнучкі grid-смуги. Одиниця fr  являє собою частку вільного простору в  grid-контейнері. Наступна сітка створює три рівних по ширині смуги які  стають більше і менше відповідно наявному простору. 

- -
-
<div class="wrapper">
-  <div>One</div>
-  <div>Two</div>
-  <div>Three</div>
-  <div>Four</div>
-  <div>Five</div>
-</div>
-
- -
.wrapper {
-  display: grid;
-  grid-template-columns: 1fr 1fr 1fr;
-}
-
- - - -

{{ EmbedLiveSample('fr_unit_ls', '220', '140') }}

-
- -

В наступному прикладі ми створюємо визначення з 2fr смугою і дві 1fr смуги. Доступний простір розділений на чотири частини, дві з яких надаються першій смузі і по одній частині кожній з наступних двох.

- -
.wrapper {
-  display: grid;
-  grid-template-columns: 2fr 1fr 1fr;
-}
-
- -

В останньому прикладі ми комбінуємо абсолютні одиниці ширини смуг з фракційними. Перша смуга  500 px, фіксована ширина відбирається з доступного простору. Решта простору ділиться на три і призначається двом гнучким смугам пропорційно. 

- -
.wrapper {
-  display: grid;
-  grid-template-columns: 500px 1fr 2fr;
-}
-
- -

Визначення смуг зі значенням repeat()

- -

Великі grid-сітки з багатьма стугами можуть використовувати значення repeat() для скорочення при визначенні стовпчиків: 

- -
.wrapper {
-  display: grid;
-  grid-template-columns: 1fr 1fr 1fr;
-}
-
- -

Також може бути записано як:

- -
.wrapper {
-  display: grid;
-  grid-template-columns: repeat(3, 1fr);
-}
-
- -

Значення repeat може використовуватись лише для частини стовпчиків. В наступному прикладі ініційовано смугу 20 рх, секцію з 6 смуг шириною 1fr, і смугу 20 рх. 

- -
.wrapper {
-  display: grid;
-  grid-template-columns: 20px repeat(6, 1fr) 20px;
-}
-
- -

Значення repeat визначає смуги, тобто його можливо використовувати для створення цілих шаблонів стовпчиків. В наступному прикладі grid-сітка складається з 10 смуг. Смуга 1fr , смуга 2fr і так п'ять разів.

- -
.wrapper {
-  display: grid;
-  grid-template-columns: repeat(5, 1fr 2fr);
-}
-
- -

Неявна і явна Grid-сітка

- -

Cтворюючи Grid-сітку нашого прикладу, ми визначили стовпчики-смуги властивістю {{cssxref("grid-template-columns")}}, але дозволимо grid-сітці створювати рядки так, як краще для контенту. Такі рядки створюються в неявній grid-сітці. Явна grid-сітка складається з рядків і стовпчиків, які визначаються властивостями  {{cssxref("grid-template-columns")}} та {{cssxref("grid-template-rows")}}.

- -

Якщо ми розташовуємо щось поза цією grid-сіткою, або кількість вмісту потребує більше grid смуг, тоді  grid-сітка створює рядки і стовпчики в неявній  grid-сітці. Такі смуги матимуть авторозмір за замовчуванням якраз щоб вмістити свій контент.

- -

Ви також можете визначити встановлений розмір для смуг, створених в неявній grid-сітці властивостями {{cssxref("grid-auto-rows")}} та {{cssxref("grid-auto-columns")}}.

- -

В прикладі нижче ми використовуємо grid-auto-rows  щоб забезпечити неявне створення смуги висотою 200 рх.

- -
<div class="wrapper">
-  <div>One</div>
-  <div>Two</div>
-  <div>Three</div>
-  <div>Four</div>
-  <div>Five</div>
-</div>
-
- -
.wrapper {
-  display: grid;
-  grid-template-columns: repeat(3, 1fr);
-  grid-auto-rows: 200px;
-}
-
- - - -

{{ EmbedLiveSample('The_implicit_and_explicit_grid', '230', '420') }}

- -

Розміри смуги і minmax()

- -

Встановлюючи явну grid-сітку або визначаючи розміри для автоматично створених рядків або стовпчиків може виникнути необхідність надання смугам мінімального розміру. Але треба переконатись що розширюючись, вони відповідатимуть будь якому доданому контенту. Наприклад ми хочемо щоб рядки ніколи не були менше 100 рх, але якщо контент розширюється до 300 рх, ми б хотіли щоб рядок розширився до такої висоти. 

- -

Grid для таких випадків має функцію {{cssxref("minmax", "minmax()")}}. В наступному прикладі я використовую minmax()в значенні {{cssxref("grid-auto-rows")}}. Це означає, що автоматично створені рядки матимуть мінімальну висоту 100 рх, а максимальну auto. Використання auto означає, що розмір буде підлаштовуватись під розмір контенту таким чином, щоб вмістити найвищий елемент в цьому рядку.

- -
.wrapper {
-  display: grid;
-  grid-template-columns: repeat(3, 1fr);
-  grid-auto-rows: minmax(100px, auto);
-}
-
- - - -
<div class="wrapper">
-  <div>One</div>
-  <div>Two
-    <p>I have some more content in.</p>
-    <p>This makes me taller than 100 pixels.</p>
-  </div>
-  <div>Three</div>
-  <div>Four</div>
-  <div>Five</div>
-</div>
- -

{{ EmbedLiveSample('Track_sizing_and_minmax()', '240', '470') }}

- -

Grid Лінії

- -

Варто зауважити що коли ми визначаємо Grid, ми визначаємо grid-смуги (але не grid-лінії). В такому випадку Grid дає нам нумеровані лінії для позиціонування елементів. В прикладі нижче Grid має 3 стовпчика, 2 рядки і 4 вертикальних лінії.

- -

Diagram showing numbered grid lines.

- -

Лінії пронумеровано згідно способу нумерації документа: зліва направо і зверху вниз (якщо на мові що викоричтовується пишуть справа наліво, то і нумерація ліній справа наліво). Лінії також можуть бути поіменовані.

- -

Позиціонування елементів по лініях

- -

Наступний приклад демонструє просте позиціонування елементів по лініях. При розміщенні елементів ми надаємо перевагу більше лініям ніж смугам.

- -

В наступному прикладі ми розміщуємо перші два елементи на Grid-cітці, яка складається з трьох смуг-стовпчиків, застосовуючи властивості {{cssxref("grid-column-start")}}, {{cssxref("grid-column-end")}}, {{cssxref("grid-row-start")}} та {{cssxref("grid-row-end")}}.  Рухаючись зліва направо, перший елемент починається з вертикальної лініі 1 і простягається до вертикальної лініі 4, що праворуч нашої Grid-сітки. Він починається на горизонтальній лінії 1 і закінчується на горизонтальній лінії 3, тобто займає два рядка смуг.

- -

Другий елемент починається з вертикальної лініі 1, і простягається на одну смугу. Це за замовчуванням, тому можна не вказувати кінцеву лінію. Також по рядках він простягається з горизонтальній лінії 3 до горизонтальній лінії 5. Інші елементи розміщуються в порожніх просторах на Grid-сітці.

- -
<div class="wrapper">
-  <div class="box1">One</div>
-  <div class="box2">Two</div>
-  <div class="box3">Three</div>
-  <div class="box4">Four</div>
-  <div class="box5">Five</div>
-</div>
-
- -
.wrapper {
-  display: grid;
-  grid-template-columns: repeat(3, 1fr);
-  grid-auto-rows: 100px;
-}
-.box1 {
-  grid-column-start: 1;
-  grid-column-end: 4;
-  grid-row-start: 1;
-  grid-row-end: 3;
-}
-.box2 {
-  grid-column-start: 1;
-  grid-row-start: 3;
-  grid-row-end: 5;
-}
-
- - - -

{{ EmbedLiveSample('Positioning_items_against_lines', '230', '420') }}

- -

Не забуваймо, що можна використовувати Grid Inspector в Firefox Developer Tools щоб побачити як елементи позиціонуються на лініях Grid-сітки.

- -

Grid-клітини

- -

Grid-клітина – найменша одиниця Grid-сітки, по аналогії з чарунком таблиці. Як ми бачили в попередніх прикладах, якщо Grid-сітка визначена як батьківська, дочірні елементи лежатимуть по одному в кожній її клітині. На зображенні кольором позначено першу клітину Grid-сітки.

- -

The first cell of the grid highlighted

- -

Grid-ділянки

- -

Елементи можуть розташовуватись на одній або декількох клітинках як в рядок так і в стовпчик, і це створює Grid-ділянки. Grid-ділянки завжди прямокутні, неможлива, наприклад, L-подібна Grid-ділянка. На зображенні Grid-ділянка займає два рядки і два стовпчики.

- -

A grid area

- -

Розриви

- -

Розриви між Grid-клітинами створюються властивістями {{cssxref("grid-column-gap")}} та {{cssxref("grid-row-gap")}}, або скорочено {{cssxref("grid-gap")}}. В наступному прикладі створюється проміжок у 10рх між стовпчиками та проміжок 1em між рядками. 

- -
.wrapper {
-  display: grid;
-  grid-template-columns: repeat(3, 1fr);
-  column-gap: 10px;
-  row-gap: 1em;
-}
- -
-

Примітка: Коли гріди тільки почали використовуватись браузерами {{cssxref("column-gap")}}, {{cssxref("row-gap")}} та {{cssxref("gap")}} мали префікси grid- як от {{cssxref("grid-column-gap")}}, {{cssxref("grid-row-gap")}} та {{cssxref("grid-gap")}} відповідно.

- -

Браузери наразі оновлюються, щоб видалити цей префікс, проте попередньо встановлені версії також будуть підтримуватися як псевдоніми, що робить їх безпечними для використання. В даний час деякі веб-переглядачі не підтримують безпрефіксний варіант, тому в прикладах цього посібника використовуюється версія з grid- префіксом.

-
- -
<div class="wrapper">
-  <div>One</div>
-  <div>Two</div>
-  <div>Three</div>
-  <div>Four</div>
-  <div>Five</div>
-</div>
- - - -

{{ EmbedLiveSample('Gutters') }}

- -

Будь-який простір, відведений на розриви, буде враховуватись до відведення простору для гнучких fr довжин смуг. Розриви використовуваються в розмітці, як звичайні grid-смуги, за виключенням того, що ви не зможете в них нічого помістити. З точки зору лінійного позиціонування розрив діє як товста лінія.

- -

Вкладені Grid-сітки

- -

Grid-елементи можуть ставати Grid-контейнерами. В попередньому прикладі ми створили Grid-сітку з трьох стовпчиків з двома позиціонованими елементами.  Перший з них має піделементи. Оскільки ці елементи не є прямими нащадками, вони не беруть участі в  Grid-розкладці і відображаються в нормальному потоці. 

- -
-
<div class="wrapper">
-  <div class="box box1">
-    <div class="nested">a</div>
-    <div class="nested">b</div>
-    <div class="nested">c</div>
-  </div>
-  <div class="box box2">Two</div>
-  <div class="box box3">Three</div>
-  <div class="box box4">Four</div>
-  <div class="box box5">Five</div>
-</div>
-
- -

Nested grid in flow

- -

Якщо застосувати display: grid до box1, то ця Grid-смуга також стане Grid-сіткою. А елементи, що в ній містяться, надалі розташовуватимуться на цій новій Grid-сітці.

- -
.box1 {
-  grid-column-start: 1;
-  grid-column-end: 4;
-  grid-row-start: 1;
-  grid-row-end: 3;
-  display: grid;
-  grid-template-columns: repeat(3, 1fr);
-}
- - -
- -

{{ EmbedLiveSample('nesting', '600', '340') }}

- -

В цьому випадку, дочірня сітка немає відношення до батьківської. Як ви можете бачити на прикладі, вона не наслідує батьківськи {{cssxref("grid-gap")}}, а також лінії дочірньої сітки не вирівнюються по лініях батьківської сітки.

- -

Під-сітка

- -

У робочій чорнетці специфікації Grid Level 2 є функція під назвою subgrid, яка має дозволити нам створювати вкладені сітки, які б використовували визначення смуги батьківської сітки.

- -
-

Примітка: під-сітки ще не реалізовані в жодному браузері, і їхня специфікація ще може змінюватися.

-
- -

У поточній специфікації ми відредагуємо вищезгаданий приклад вкладеної Grid-сітки, змінивши визначення смуги з grid-template-columns: repeat(3, 1fr) , на grid-template-columns: subgrid. Вкладена сітка надалі використовуватиме батьківські Grid-смуги до елементів макета.

- -
.box1 {
-  grid-column-start: 1;
-  grid-column-end: 4;
-  grid-row-start: 1;
-  grid-row-end: 3;
-  display: grid;
-  grid-template-columns: subgrid;
-}
- -

Нашарування елементів за допомогою z-index

- -

Grid-елементи можуть займати одну і ту ж саму клітину. Якщо повернутись до нашого прикладу з елементами, що розташовані за номером рядка, ми можемо змінити його так, щоб два елементи перекривали один одного.

- -
-
<div class="wrapper">
-  <div class="box box1">One</div>
-  <div class="box box2">Two</div>
-  <div class="box box3">Three</div>
-  <div class="box box4">Four</div>
-  <div class="box box5">Five</div>
-</div>
- -
.wrapper {
-  display: grid;
-  grid-template-columns: repeat(3, 1fr);
-  grid-auto-rows: 100px;
-}
-
-.box1 {
-  grid-column-start: 1;
-  grid-column-end: 4;
-  grid-row-start: 1;
-  grid-row-end: 3;
-}
-
-.box2 {
-  grid-column-start: 1;
-  grid-row-start: 2;
-  grid-row-end: 4;
-}
- - -
- -

{{ EmbedLiveSample('l_ex', '230', '420') }}

- -

Елемент box2 тепер перекриває box1, він відображається зверху, тому що пізніше трапляеться в коді документу.

- -

Керування послідовністю

- -

Ми можемо контролювати порядок, в якому елементи накладаються один на одного, використовуючи властивість z-index. Якщо надати box2 нижчий z-index, ніж в box1, то він і буде показаний нижче у стеці.

- -
.wrapper {
-  display: grid;
-  grid-template-columns: repeat(3, 1fr);
-  grid-auto-rows: 100px;
-}
-
-.box1 {
-  grid-column-start: 1;
-  grid-column-end: 4;
-  grid-row-start: 1;
-  grid-row-end: 3;
-  z-index: 2;
-}
-
-.box2 {
-  grid-column-start: 1;
-  grid-row-start: 2;
-  grid-row-end: 4;
-  z-index: 1;
-}
-
- - - -

{{ EmbedLiveSample('Controlling_the_order', '230', '420') }}

- -

Наступні кроки

- -

У цій статті ми швидко переглянули специфікацію Grid Layout. Пограйте з прикладами коду, а потім переходьте до наступної частини цього посібника, де ми насправді почнемо заглиблюватись в деталі CSS Grid Layout.

- - diff --git a/files/uk/web/css/css_grid_layout/index.html b/files/uk/web/css/css_grid_layout/index.html deleted file mode 100644 index e403f8364f..0000000000 --- a/files/uk/web/css/css_grid_layout/index.html +++ /dev/null @@ -1,245 +0,0 @@ ---- -title: CSS Grid Layout -slug: Web/CSS/CSS_Grid_Layout -tags: - - CSS - - Grid Layout - - Grids - - Layout - - NeedsTranslation - - Overview - - Reference - - TopicStub -translation_of: Web/CSS/CSS_Grid_Layout ---- -

CSS Grid layout відзначається тим, що розділяє сторінку на ділянки чи задає співвідношення між елементами, побудованими з HTML примітивів, з точки зору розміру, положення та слоїв.

- -

Подібно до таблиць, CSS Grid дозволяє автору вирівнювати елементи у стовпчиках та рядках. Однак, CSS Grid, в порівнянні з таблицями, надає більше можливостей і полегшує створення макетів. Наприклад, дочірні елементи Grid-контейнера можуть перекривати один одного і нашаровуватись, подібно до позиційованих CSS елементів.

- -

Базовий приклад

- -

У наведеному нижче прикладі показана сітка з трьома стовпчиками, в якій нові рядки мають мінімальну висоту 100 пікселів, а максимальна висота вираховується автоматично. Елементи розміщені в сітці використовуючи лінійне розташування .

- -
- - -

HTML

- -
<div class="wrapper">
-  <div class="one">One</div>
-  <div class="two">Two</div>
-  <div class="three">Three</div>
-  <div class="four">Four</div>
-  <div class="five">Five</div>
-  <div class="six">Six</div>
-</div>
- -

CSS

- -
.wrapper {
-  display: grid;
-  grid-template-columns: repeat(3, 1fr);
-  grid-gap: 10px;
-  grid-auto-rows: minmax(100px, auto);
-}
-.one {
-  grid-column: 1 / 3;
-  grid-row: 1;
-}
-.two {
-  grid-column: 2 / 4;
-  grid-row: 1 / 3;
-}
-.three {
-  grid-column: 1;
-  grid-row: 2 / 5;
-}
-.four {
-  grid-column: 3;
-  grid-row: 3;
-}
-.five {
-  grid-column: 2;
-  grid-row: 4;
-}
-.six {
-  grid-column: 3;
-  grid-row: 4;
-}
-
- -

{{ EmbedLiveSample('example', '500', '440') }}

-
- -

Посилання

- -

CSS властивості

- -
- -
- -

CSS функції

- -
- -
- -

Глосарій

- -
- -
- -

Посібники

- -
- -
- -

Зовнішні ресурси

- - - -

Специфікації

- - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{ SpecName('CSS3 Grid') }}{{ Spec2('CSS3 Grid') }}Initial definition.
- - diff --git a/files/uk/web/css/css_grid_layout/relationship_of_grid_layout/index.html b/files/uk/web/css/css_grid_layout/relationship_of_grid_layout/index.html deleted file mode 100644 index 7f715c0986..0000000000 --- a/files/uk/web/css/css_grid_layout/relationship_of_grid_layout/index.html +++ /dev/null @@ -1,628 +0,0 @@ ---- -title: Relationship of grid layout to other layout methods -slug: Web/CSS/CSS_Grid_Layout/Relationship_of_Grid_Layout -translation_of: Web/CSS/CSS_Grid_Layout/Relationship_of_Grid_Layout ---- -

CSS Grid Layout has been designed to work alongside other parts of CSS, as part of a complete system for doing the layout. In this guide, I will explain how a grid fits together with other techniques you may already be using.

- -

Grid and flexbox

- -

The basic difference between CSS Grid Layout and CSS Flexbox Layout is that flexbox was designed for layout in one dimension - either a row or a column. Grid was designed for two-dimensional layout - rows, and columns at the same time. The two specifications share some common features, however, and if you have already learned how to use flexbox, the similarities should help you get to grips with Grid.

- -

Одновимірні макети проти двовимірних

- -

A simple example can demonstrate the difference between one- and two-dimensional layouts.

- -

In this first example, I am using flexbox to lay out a set of boxes. I have five child items in my container, and I have given the flex properties values so that they can grow and shrink from a flex-basis of 200 pixels.

- -

I have also set the {{cssxref("flex-wrap")}} property to wrap, so that if the space in the container becomes too narrow to maintain the flex basis, items will wrap onto a new row.

- -
- - -
<div class="wrapper">
-  <div>One</div>
-  <div>Two</div>
-  <div>Three</div>
-  <div>Four</div>
-  <div>Five</div>
-</div>
-
- -
.wrapper {
-  display: flex;
-  flex-wrap: wrap;
-}
-.wrapper > div {
-  flex: 1 1 200px;
-}
-
-
- -

{{ EmbedLiveSample('onedtwod', '500', '230') }}

- -

In the image, you can see that two items have wrapped onto a new line. These items are sharing the available space and not lining up underneath the items above. This is because when you wrap flex items, each new row (or column when working by column) becomes a new flex container. Space distribution happens across the row.

- -

A common question then is how to make those items line up. This is where you want a two-dimensional layout method: You want to control the alignment by row and column, and this is where grid comes in.

- -

The same layout with CSS grids

- -

In this next example, I create the same layout using Grid. This time we have three 1fr column tracks. We do not need to set anything on the items themselves; they will lay themselves out one into each cell of the created grid. As you can see they stay in a strict grid, lining up in rows and columns. With five items, we get a gap on the end of row two.

- -
- - -
<div class="wrapper">
-  <div>One</div>
-  <div>Two</div>
-  <div>Three</div>
-  <div>Four</div>
-  <div>Five</div>
-</div>
-
- -
.wrapper {
-  display: grid;
-  grid-template-columns: repeat(3, 1fr);
-}
-
- -

{{ EmbedLiveSample('Two_Dimensional_With_Grid', '300', '170') }}

-
- -

A simple question to ask yourself when deciding between grid or flexbox is:

- - - -

Content out or layout in?

- -

In addition to the one-dimensional versus two-dimensional distinction, there is another way to decide if you should use flexbox or grid for a layout. Flexbox works from the content out. An ideal use case for flexbox is when you have a set of items and want to space them out evenly in a container. You let the size of the content decide how much individual space each item takes up. If the items wrap onto a new line, they will work out their spacing based on their size and the available space on that line.

- -

Grid works from the layout in. When you use CSS Grid Layout you create a layout and then you place items into it, or you allow the auto-placement rules to place the items into the grid cells according to that strict grid. It is possible to create tracks that respond to the size of the content, however, they will also change the entire track.

- -

If you are using flexbox and find yourself disabling some of the flexibility, you probably need to use CSS Grid Layout. An example would be if you are setting a percentage width on a flex item to make it line up with other items in a row above. In that case, a grid is likely to be a better choice.

- -

Box alignment

- -

The feature of flexbox that was most exciting to many of us was that it gave us proper alignment control for the first time. It made it easy to center a box on the page. Flex items can stretch to the height of the flex container, meaning that equal height columns were possible. These were things we have wanted to do for a very long time, and have come up with all kinds of hacks to at least create the visual effect of.

- -

The alignment properties from the flexbox specification have been added to a new specification called Box Alignment Level 3. This means that they can be used in other specifications, including Grid Layout. In the future, they may well apply to other layout methods as well.

- -

In a later guide in this series, I’ll be taking a proper look at Box Alignment and how it works in Grid Layout. For now, here is a comparison between simple examples of flexbox and grid.

- -

In the first example, which uses flexbox, I have a container with three items inside. The wrapper {{cssxref("min-height")}} is set, so it defines the height of the flex container. I have set {{cssxref("align-items")}} on the flex container to flex-end so the items will line up at the end of the flex container. I have also set the {{cssxref("align-self")}} property on box1 so it will override the default and stretch to the height of the container and on box2 so it aligns to the start of the flex container.

- - - -
<div class="wrapper">
-  <div class="box1">One</div>
-  <div class="box2">Two</div>
-  <div class="box3">Three</div>
-</div>
-
- -
.wrapper {
-  display: flex;
-  align-items: flex-end;
-  min-height: 200px;
-}
-.box1 {
-  align-self: stretch;
-}
-.box2 {
-  align-self: flex-start;
-}
-
- -

{{ EmbedLiveSample('Box_alignment', '300', '230') }}

- -

Alignment in CSS Grids

- -

This second example uses a grid to create the same layout. This time we are using the box alignment properties as they apply to a grid layout. So we align to start and end rather than flex-start and flex-end. In the case of a grid layout, we are aligning the items inside their grid area. In this case that is a single grid cell, but it could be an area made up of several grid cells.

- - - -
<div class="wrapper">
-  <div class="box1">One</div>
-  <div class="box2">Two</div>
-  <div class="box3">Three</div>
-</div>
-
- -
.wrapper {
-  display: grid;
-  grid-template-columns: repeat(3,1fr);
-  align-items: end;
-  grid-auto-rows: 200px;
-}
-.box1 {
-  align-self: stretch;
-}
-.box2 {
-  align-self: start;
-}
-
- -

{{ EmbedLiveSample('Alignment_in_CSS_Grids', '200', '310') }}

- -

The fr unit and flex-basis

- -

We have already seen how the fr unit works to assign a proportion of available space in the grid container to our grid tracks. The fr unit, when combined with the {{cssxref("minmax", "minmax()")}} function can give us very similar behavior to the flex properties in flexbox while still enabling the creation of a layout in two dimensions.

- -

If we look back at the example where I demonstrated the difference between one and two-dimensional layouts, you can see there is a difference between the way of the two layouts work responsively. With the flex layout, if we drag our window wider and smaller, the flexbox does a nice job of adjusting the number of items in each row according to the available space. If we have a lot of space all five items can fit on one row. If we have a very narrow container we may only have space for one.

- -

In comparison, the grid version always has three column tracks. The tracks themselves will grow and shrink, but there are always three since we asked for three when defining our grid.

- -

Auto-filling grid tracks

- -

We can create a similar effect to flexbox, while still keeping the content arranged in strict rows and columns, by creating our track listing using repeat notation and the auto-fill and auto-fit properties.

- -

In this next example, I have used the auto-fill keyword in place of an integer in the repeat notation and set the track listing to 200 pixels. This means that grid will create as many 200 pixels column tracks as will fit in the container.

- - - -
<div class="wrapper">
-  <div>One</div>
-  <div>Two</div>
-  <div>Three</div>
-</div>
-
- -
.wrapper {
-  display: grid;
-  grid-template-columns: repeat(auto-fill, 200px);
-}
-
- -

{{ EmbedLiveSample('Auto-filling_grid_tracks', '500', '170') }}

- -

A flexible number of tracks

- -

This isn’t quite the same as flexbox. In the flexbox example, the items are larger than the 200 pixel basis before wrapping. We can achieve the same in grid by combining auto-fill and the {{cssxref("minmax", "minmax()")}} function. In this next example, I create auto filled tracks with minmax. I want my tracks to be a minimum of 200 pixels, so I set the maximum to be 1fr. Once the browser has worked out how many times 200 pixels will fit into the container–also taking account of grid gaps–it will treat the 1fr maximum as an instruction to share out the remaining space between the items.

- - - -
<div class="wrapper">
-  <div>One</div>
-  <div>Two</div>
-  <div>Three</div>
-</div>
-
- -
.wrapper {
-  display: grid;
-  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
-}
-
- -

{{ EmbedLiveSample('A_flexible_number_of_tracks', '500', '170') }}

- -

We now have the ability to create a grid with a flexible number of flexible tracks, but see items laid out on the grid aligned by rows and columns at the same time.

- -

Grid and absolutely positioned elements

- -

Grid interacts with absolutely positioned elements, which can be useful if you want to position an item inside a grid or grid area. The specification defines the behavior when a grid container is a containing block and a parent of the absolutely positioned item.

- -

A grid container as containing block

- -

To make the grid container a containing block you need to add the position property to the container with a value of relative, just as you would make a containing block for any other absolutely positioned items. Once you have done this, if you give a grid item position: absolute it will take as its containing block the grid container or, if the item also has a grid position, the area of the grid it is placed into.

- -

In the below example I have a wrapper containing four child items. Item three is absolutely positioned and also placed on the grid using line-based placement. The grid container has position: relative and so becomes the positioning context of this item.

- - - -
<div class="wrapper">
-  <div class="box1">One</div>
-  <div class="box2">Two</div>
-  <div class="box3">
-   This block is absolutely positioned. In this example the grid container is the containing block and so the absolute positioning offset values are calculated in from the outer edges of the area it has been placed into.
-  </div>
-  <div class="box4">Four</div>
-</div>
-
- -
.wrapper {
-  display: grid;
-  grid-template-columns: repeat(4,1fr);
-  grid-auto-rows: 200px;
-  grid-gap: 20px;
-  position: relative;
-}
-.box3 {
-  grid-column-start: 2;
-  grid-column-end: 4;
-  grid-row-start: 1;
-  grid-row-end: 3;
-  position: absolute;
-  top: 40px;
-  left: 40px;
-}
-
- -

{{ EmbedLiveSample('A_grid_container_as_containing_block', '500', '330') }}

- -

You can see that the item is taking the area from grid row line 2 to 4, and starting after line 1. Then it is offset in that area using the top and left properties. However, it has been taken out of flow as is usually for absolutely positioned items and so the auto-placement rules now place items into the same space. The item also doesn’t cause the additional row to be created to span to row line 3.

- -

If we remove position: absolute from the rules for .box3 you can see how it would display without the positioning.

- -

A grid container as parent

- -

If the absolutely positioned child has a grid container as a parent but that container does not create a new positioning context, then it is taken out of flow as in the previous example. The positioning context will be whatever element creates a positioning context as is common to other layout methods. In our case, if we remove position: relative from the wrapper above, positioning context is from the viewport, as shown in this image.

- -

Image of grid container as parent

- -

Once again the item no longer participates in the grid layout in terms of sizing or when other items are auto-placed.

- -

With a grid area as the parent

- -

If the absolutely positioned item is nested inside a grid area then you can create a positioning context on that area. In the below example we have our grid as before but this time I have nested an item inside .box3 of the grid.

- -

I have given .box3 position relative and then positioned the sub-item with the offset properties. In this case, the positioning context is the grid area.

- - - -
<div class="wrapper">
-  <div class="box1">One</div>
-  <div class="box2">Two</div>
-  <div class="box3">Three
-    <div class="abspos">
-     This block is absolutely positioned. In this example the grid area is the containing block and so the absolute positioning offset values are calculated in from the outer edges of the grid area.
-    </div>
-  </div>
-  <div class="box4">Four</div>
-</div>
-
- -
.wrapper {
-  display: grid;
-  grid-template-columns: repeat(4,1fr);
-  grid-auto-rows: 200px;
-  grid-gap: 20px;
-}
-.box3 {
-  grid-column-start: 2;
-  grid-column-end: 4;
-  grid-row-start: 1;
-  grid-row-end: 3;
-  position: relative;
-}
-.abspos {
-  position: absolute;
-  top: 40px;
-  left: 40px;
-  background-color: rgba(255,255,255,.5);
-  border: 1px solid rgba(0,0,0,0.5);
-  color: #000;
-  padding: 10px;
-}
-
- -

{{ EmbedLiveSample('With_a_grid_area_as_the_parent', '500', '420') }}

- -

Grid and display: contents

- -

A final interaction with another layout specification that is worth noting is the interaction between CSS Grid Layout and display: contents. The contents value of the display property is a new value that is described in the Display specification as follows:

- -
-

“The element itself does not generate any boxes, but its children and pseudo-elements still generate boxes as normal. For the purposes of box generation and layout, the element must be treated as if it had been replaced with its children and pseudo-elements in the document tree.”

-
- -

If you set an item to display: contents the box it would normally create disappears, and the boxes of the child elements appear as if they have risen up a level. This means that children of a grid item can become grid items. Sound odd? Here is a simple example. In the following markup, I have a grid and the first item on the grid is set to span all three column tracks. It contains three nested items. As these items are not direct children, they don’t become part of the grid layout and so display using regular block layout.

- -
- - -
<div class="wrapper">
-  <div class="box box1">
-    <div class="nested">a</div>
-    <div class="nested">b</div>
-    <div class="nested">c</div>
-  </div>
-  <div class="box box2">Two</div>
-  <div class="box box3">Three</div>
-  <div class="box box4">Four</div>
-  <div class="box box5">Five</div>
-</div>
-
- -
.wrapper {
-  display: grid;
-  grid-template-columns: repeat(3, 1fr);
-  grid-auto-rows: minmax(100px, auto);
-}
-.box1 {
-  grid-column-start: 1;
-  grid-column-end: 4;
-}
-
-
- -

{{ EmbedLiveSample('Display_Contents_Before', '400', '420') }}

-
- -

If I now add display: contents to the rules for box1, the box for that item vanishes and the sub-items now become grid items and lay themselves out using the auto-placement rules.

- -
- - -
<div class="wrapper">
-  <div class="box box1">
-    <div class="nested">a</div>
-    <div class="nested">b</div>
-    <div class="nested">c</div>
-  </div>
-  <div class="box box2">Two</div>
-  <div class="box box3">Three</div>
-  <div class="box box4">Four</div>
-  <div class="box box5">Five</div>
-</div>
-
- -
.wrapper {
-  display: grid;
-  grid-template-columns: repeat(3, 1fr);
-  grid-auto-rows: minmax(100px, auto);
-}
-.box1 {
-  grid-column-start: 1;
-  grid-column-end: 4;
-  display: contents;
-}
-
- -

{{ EmbedLiveSample('Display_Contents_After', '400', '330') }}

-
- -

This can be a way to get items nested into the grid to act as if they are part of the grid, and is a way around some of the issues that would be solved by subgrids once they are implemented. You can also use display: contents in a similar way with flexbox to enable nested items to become flex items.

- -

As you can see from this guide, CSS Grid Layout is just one part of your toolkit. Don’t be afraid to mix it with other methods of doing layout to get the different effects you need.

- -

See Also

- - - - diff --git a/files/uk/web/css/css_selectors/index.html b/files/uk/web/css/css_selectors/index.html deleted file mode 100644 index 20f89ab44f..0000000000 --- a/files/uk/web/css/css_selectors/index.html +++ /dev/null @@ -1,116 +0,0 @@ ---- -title: CSS селектори -slug: Web/CSS/CSS_Selectors -translation_of: Web/CSS/CSS_Selectors ---- -
{{CSSRef("Selectors")}}
- -

CSS селектори  означують елемнти до яких застосовується набір правил CSS.

- -

Прості селектори

- -
-
Селектор за типом (Type selector)
-
Вибирає всі елементи, що відповідають вказаному імені вузла.
- Syntax: eltname
- Example: input буде відповідати будь-якому елементу {{HTMLElement("input")}} .
-
Селектор за класом (Class selector)
-
Вибирає всі елементи, що відповідають вказаному атрибуту class.
- Syntax: .classname
- Example: .index буде відповідати будь-якому елементу, що має клас "index".
-
Селектор за ID (ID selector)
-
Вибирає елемент, відповідно до його значення атрибуту id. В документі повинен бути тільки один елемент з вказаним ID.
- Syntax: #idname
- Example: #toc буде відповідати елементу, що має ID зі значенням "toc".
-
Універсальний селектор (Universal selector)
-
Вибирає усі елементи. За бажанням, він може бути обмежений певним простором імен або всім простором імен.
- Syntax: * ns|* *|*
- Example: * буде відповідати усім елементам документу.
-
Селектор за атрибутом (Attribute selector)
-
Вибирає елементи, відповідно до його значення вказаного атрибуту.
- Syntax: [attr] [attr=value] [attr~=value] [attr|=value] [attr^=value] [attr$=value] [attr*=value]
- Example: [autoplay] буде відповідати всім елементам що мають виставлений атрибут autoplay (в будь яке значення).
-
- -

Комбінатори

- -
-
Комбінатор прилеглого елемента
-
Комбінатор + вибирає прилеглі  елементи, що мають спільного нащадка (рівноправні). Це означає, що наступний елемент слідує безпосередньо за попереднім, і в обидвох спільний предок (обидва класи знаходятся в одному старшому класі).
- Синтаксис: A + B
- Приклад:  під дію h2 + p підпадуть усі випадки, у яких елемент  {{HTMLElement("p")}} знаходиться безпосередньо після елемента  {{HTMLElement("h2")}}.
-
Загальний комбінатор прилеглих елементів
-
Комбінатор ~ обирає сусідні елементи. Це значить, що другий елемент слідує за першим (хоча і не обов'язково безпосередньо зразу після нього), і обидва елементи знаходяться в межах лдного предка.
- Синтаксис: A ~ B
- Приклад: p ~ span відповідатиме усім випадкам, коли елемент {{HTMLElement("span")}} слідує за елементом {{HTMLElement("p")}}.
-
Комбінатор прямого нащадка
-
Комбінатор > обирає усі вузли (теги одного класу), які є прямими нащадками елемента, вказзаного першим.
- Синтаксис: A > B
- Приклад: ul > li відповідатиме усім випадкам, коли елемент  {{HTMLElement("li")}} буде вкладеним прямо в елемент {{HTMLElement("ul")}} (елемент  {{HTMLElement("ul")}} складається з {{HTMLElement("li")}}, що значить, що {{HTMLElement("li")}} є його прямим нащадком.
-
Комбінатор за нащадками (Descendant combinator)
-
Комбінатор   (space) обирає всі вузли, що є нащадками першого елемента.
- Синтаксис: A B
- Приклад: div span обиратиме усі елементи {{HTMLElement("span")}}, що знаходяться всередині елемента {{HTMLElement("div")}}, хоча і необов'язково напряму (елемент {{HTMLElement("span")}} може бути всередині {{HTMLElement("table")}}, яка знаходиться в {{HTMLElement("div")}}).
-
Стовпчиковий комбінатор {{Experimental_Inline}}
-
Комбінатор || вибирає усі вузли, що належать стовпчику.
- Синтаксис: A || B
- Приклад: col || td застосовуватиметься до усіх елементів {{HTMLElement("td")}}, що потрапляють в зону застосування {{HTMLElement("col")}}.
-
- -

Псевдо-класи

- -
-
Псевдо-класи роблятть можливим вибір елементів, базуючись на інформаціїї, що не знаходиться в дереві елементів.
-
Приклад: a:visited застосовуватиметься для усіх {{HTMLElement("a")}}, що були відвідані користувачем.
-
- -

Псевдо-елементи

- -
-
Псевдо-елементи представляють собою об'єкти, що не включені до HTML.
-
Приклад: p::first-line застосовуватиметься лише до першої стрічки елементів {{HTMLElement("p")}}.
-
- -

Specifications

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName("CSS4 Selectors")}}{{Spec2("CSS4 Selectors")}}Added the || column combinator, grid structural selectors, logical combinators, location, time-demensional, resource state, linguistic and UI pseudo-classes
{{SpecName("CSS3 Selectors")}}{{Spec2("CSS3 Selectors")}}Added the ~ general sibling combinator and tree-structural pseudo-classes.
- Made pseudo-elements use a :: double-colon prefix. Additional attribute selectors
{{SpecName("CSS2.1", "selector.html")}}{{Spec2("CSS2.1")}}Added the > child and + adjacent sibling combinators.
- Added the universal and attribute selectors.
{{SpecName("CSS1")}}{{Spec2("CSS1")}}Initial definition.
- -

See the pseudo-class and pseudo-element specification tables for details on those.

- -

Див також

- - diff --git a/files/uk/web/css/filter/index.html b/files/uk/web/css/filter/index.html deleted file mode 100644 index aca5425654..0000000000 --- a/files/uk/web/css/filter/index.html +++ /dev/null @@ -1,1184 +0,0 @@ ---- -title: filter -slug: Web/CSS/filter -translation_of: Web/CSS/filter ---- -
{{CSSRef}}{{SeeCompatTable}}
- -

Опис

- -

Властивість filter дає можливість застосувати до елементів такі графічні ефекти, як розмиття (blurring), збільшення чіткості (sharpening), зміна кольорів (color shifting). Зазвичай фільтри викорустовуються для налаштування рендерингу зображень, фонів (backgrounds) та границь (borders).

- -

У CSS стандарт включені декілька функцій, які досягають визначених ефектів. Ви можете також посилатися на SVG-фільтр за допомогою посилання(URL) на SVG filter element.

- -
Примітка: Більш старі версії браузера Windows Internet Explorer (4.0 - 9.0) підтримували нестандартний "filter", який з того часу є застарілим.
- -

{{cssinfo}}

- -

Syntax

- -
filter: url("filters.svg#filter-id");
-filter: blur(5px);
-filter: brightness(0.4);
-filter: contrast(200%);
-filter: drop-shadow(16px 16px 20px blue);
-filter: grayscale(50%);
-filter: hue-rotate(90deg);
-filter: invert(75%);
-filter: opacity(25%);
-filter: saturate(30%);
-filter: sepia(60%);
-
-/* Apply multiple filters */
-filter: contrast(175%) brightness(3%);
-
-/* Global values */
-filter: inherit;
-filter: initial;
-filter: unset;
-
- -

З функцією використовуйте наступне:

- -
filter: <filter-function> [<filter-function>]* | none
-
- -

Для посилання на SVG {{SVGElement("filter")}} елемент використовуйте наступне:

- -
filter: url(file.svg#filter-element-id)
-
- -

Формальний синтаксис

- -{{csssyntax}} - -

Приклади

- -

Приклади використання визначених функцій подаються нижче. Дивіться кожну функцію для конкретного прикладу.

- -
.mydiv { filter: grayscale(50%) }
-
-/* зробить сірим на 50% та розмиє на 10px */
-img {
-  filter: grayscale(0.5) blur(10px);
-}
- -

Приклади використання URL функції з SVG ресурсом наведені нижче.

- -
.target { filter: url(#c1); }
-
-.mydiv { filter: url(commonfilters.xml#large-blur) }
-
- -

Функції

- -

Для того, щоб використовувати CSS властивість filter, необхідно вказати значення (value) для однієї з наступних функцій. Якщо значення не є валідним, функція повертає "none". За винятком зазначених випадків, функції, які приймають значення, виражені у відсотках (наприклад, 34%), також приймають і ті значення, що виражені десятковим дробом (наприклад, 0.34).

- -

url()

- -

Функція url() приймає місцезнаходження XML-файлу, який визначає SVG-фільтр і має містити якір(anchor) до конкретного фільтр-елемента.

- -
filter: url(resources.svg#c1)
-
- -

blur()

- -

Розмиття. Застосовує гаусове (Gaussian) розмиття до вхідного зображення. Значення радіусу (‘radius’) встановлює значення стандартного відхилення до гауссової (Gaussian) функції, або на скільки пікселі екрану мають зливатися один з одним. Тому більше значення забеспечить більше розмиття. Якщо жоден параметр не вказаний, використовується значення "0". Параметр визначений, як CSS довжина, але не приймає значень у відсотках.

- -
filter: blur(5px)
-
- - - -
<svg style="position: absolute; top: -99999px" xmlns="http://www.w3.org/2000/svg">
-  <filter id="svgBlur" x="-5%" y="-5%" width="110%" height="110%">
-    <feGaussianBlur in="SourceGraphic" stdDeviation="5"/>
-  </filter>
-</svg>
- -

{{EmbedLiveSample('blur_example','100%','236px','')}}

- -

brightness()

- -

Яскравість. Застосовує лінійний множник(мультиплікатор) до вхідного зображення, щоб зробити його більш або менш яскравим. Значення "0%" створить абсолютно чорне зображення. Значення "100%" залишить зображення без змін. Інші значення є лінійними мультиплікаторами, що застосовуються до ефекту. Значення, більші за "100%", дозволяються і дають більш яскраві результати. Якщо параметр ‘amount’ не вказаний, використовується значення "1".

- -
filter: brightness(0.5)
- -
<svg style="position: absolute; top: -99999px" xmlns="http://www.w3.org/2000/svg">
- <filter id="brightness">
-    <feComponentTransfer>
-        <feFuncR type="linear" slope="[amount]"/>
-        <feFuncG type="linear" slope="[amount]"/>
-        <feFuncB type="linear" slope="[amount]"/>
-    </feComponentTransfer>
-  </filter>
-</svg>
- - - -

{{EmbedLiveSample('brightness_example','100%','231px','')}}

- -

contrast()

- -

Контрастність. Налаштовує контраст зображення. Значення "0%" створить абсолютно сіре зображення. Значення "100%" залишить зображення без змін. Значення, більші за "100%", дозволяються і дають більш контрастні результати. Якщо параметр ‘amount’ не вказаний, використовується значення "1". 

- -
filter: contrast(200%)
-
- -
<svg style="position: absolute; top: -99999px" xmlns="http://www.w3.org/2000/svg">
-  <filter id="contrast">
-    <feComponentTransfer>
-      <feFuncR type="linear" slope="[amount]" intercept="-(0.5 * [amount]) + 0.5"/>
-      <feFuncG type="linear" slope="[amount]" intercept="-(0.5 * [amount]) + 0.5"/>
-      <feFuncB type="linear" slope="[amount]" intercept="-(0.5 * [amount]) + 0.5"/>
-    </feComponentTransfer>
-  </filter>
-</svg>
-
- - - -

{{EmbedLiveSample('contrast_example','100%','203px','')}}

- -

drop-shadow()

- -

Відкидання тіні. Застосовує відкидання тіні до вхідного зображення. Це фактично розмита, зміщена версія альфа-маски вхідного зображення,  намальована певним кольором та створена під зображенням. Функція приймає параметр типу <shadow> (визначена у CSS3 Backgrounds), за винятком того, що ключове слово ‘inset’ не дозволене. Дана функція дуже схода на більш укорінену властивість {{cssxref("box-shadow")}}; різниця у тому, що у випадку з фільтрами деякі браузери забезпечують апаратне прискорення для більш високої продуктивності. Нижче наведені параметри параметра <shadow>.

- -
-
<offset-x> <offset-y> (required)
-
Ці два обов'язкові {{cssxref("<length>")}} значення вказують зміщення тіні. <offset-x> визначає горизонтальну відстань. Від’ємні значення розміщують тінь лівіше елемента. <offset-y> визначає вертикальну відстань. Від’ємні значення розміщують тінь вище елемента. Дивіться {{cssxref("<length>")}} можливі одиниці. Якщо обидва значення "0", тінь розміщується за елементом (і може створювати ефект ромиття, якщо вказані <blur-radius> та/або <spread-radius>).
-
<blur-radius> (optional)
-
Це необов'язкове третє {{cssxref("<length>")}} значення. Чим більше значення, тим більше розмиття, тим більшою і світлішою стає тінь. Від’ємні значення не дозволені. Якщо значення не визначене, воно буде "0" (межі тіні будуть чіткими).
-
<spread-radius> (optional)
-
Це необов'язкове четверте {{cssxref("<length>")}} значення. Додатні значення розширять тінь і зроблять її більшою, а від'ємні - зменшать. Якщо значення не визначено, воно буде "0" (тінь буде мати какий розмір, як зображення). 
- Примітка: Webkit та, можливо, інші браузери, не підтримують цей четвертий параметр; він не виконається, якщо його додати.
-
<color> (optional)
-
Дивіться {{cssxref("<color>")}} значення, щоб дізнатися можливі ключові слова та умовні позначення. Якщо значення не вказано, колір залежить від браузера. У Gecko (Firefox), Presto (Opera) та Trident (Internet Explorer), значення {{cssxref("color")}} властивості використовується. З іншого боку, тінь WebKit є прозорою, тому вона є марою, даремною, якщо значення <color> не вказане.
-
- -
filter: drop-shadow(16px 16px 10px black)
- -
<svg style="position: absolute; top: -999999px" xmlns="http://www.w3.org/2000/svg">
- <filter id="drop-shadow">
-    <feGaussianBlur in="SourceAlpha" stdDeviation="[radius]"/>
-    <feOffset dx="[offset-x]" dy="[offset-y]" result="offsetblur"/>
-    <feFlood flood-color="[color]"/>
-    <feComposite in2="offsetblur" operator="in"/>
-    <feMerge>
-      <feMergeNode/>
-      <feMergeNode in="SourceGraphic"/>
-    </feMerge>
-  </filter>
-</svg>
-
- - - -

{{EmbedLiveSample('shadow_example','100%','300px','')}}

- -

grayscale()

- -

Конвертує вхідне зображення у відтінках сірого. Значення ‘amount’ визначає пропорцію конвертації. Значення "100%" повністю конвертує зображення у відтінки сірого. Значення "0%" залишає зобращення без змін. Значення між "0%" та "100%" є лінійними множниками(мультиплікаторами) ефекта. Якщо парамент ‘amount’  не вказаний, використовується значення "0".

- -
filter: grayscale(100%)
- - - -

{{EmbedLiveSample('grayscale_example','100%','209px','')}}

- -

hue-rotate()

- -

Зміна відтінків. Застосовує зміну відтінків до вхідного зображення. Значення ‘angle’ визначає кількість градусів на колірному крузі (color circle), які будуть застосовані до вхідного зображення. Значення (0deg) залишає зображення без змін. Якщо параметр  ‘angle’  відсутній, використовується значення "0deg". Хоча і не існує максимального значення, ефект значень, більших за "360deg", буде обертатися навколо.

- -
filter: hue-rotate(90deg)
- - - -
<svg style="position: absolute; top: -999999px" xmlns="http://www.w3.org/2000/svg">
-  <filter id="svgHueRotate" >
-    <feColorMatrix type="hueRotate" values="[angle]" />
-  <filter />
-</svg>
- -

{{EmbedLiveSample('huerotate_example','100%','221px','')}}

- -

invert()

- -

Інвертування. Інвертує зразки (samples) у вхідному зображенні. Значення ‘amount’ визначає пропорцію конвертації. Значення "100%" інвертує зображення повністю. Значення "0%" залишає зображення без змін. Значення між "0%" та "100%" є лінійними множниками (мультиплікаторами) ефекта. Якщо параметр ‘amount’  відсутній, використовується значення "0".

- -
filter: invert(100%)
- - - -

{{EmbedLiveSample('invert_example','100%','407px','')}}

- -

opacity()

- -

Непрозорість. Застосовує прозорість до вхідного зображення. Значення ‘amount’ визначає пропорцію конвертації. Зі значенням "0%" зображення стає повністю прозорим. Значення "100%" залишає зображення без змін. Значення між "0%" та "100%" є лінійними множниками (мультиплікаторами) ефекта. Це еквівалентно множенню зразків (samples) зображення на  ‘amount’. Якщо параметр ‘amount’  відсутній, використовується значення "1". Ця функція схожа на більш укорінену властивість {{Cssxref("opacity")}}; ріниця полягає у тому,  що у випадку з фільтрами деякі браузери забезпечують апаратне прискорення для більш високої продуктивності.

- -
filter: opacity(50%)
- - - -

{{EmbedLiveSample('opacity_example','100%','210px','')}}

- -

saturate()

- -

Насичення. Робить зображення більш насиченими. Значення ‘amount’ визначає пропорцію конвертації. Зі значенням "0%" зображення стає повністю ненасиченим. Значення "100%" залишає зображення без змін. Інші значення є лінійними множниками (мультиплікаторами) ефекта. Значення, більші за "100%" дозволяються і забеспечують більш насиченими результатами. Якщо параметр ‘amount’ відсутній, використовується значення "1".

- -
filter: saturate(200%)
- - - -

{{EmbedLiveSample('saturate_example','100%','332px','')}}

- -

sepia()

- -

Сепія. Конвертує зображення до сепії. Значення ‘amount’ визначає пропорцію конвертації. Значення "100%" конвертує зображення повністю. Значення "0%" залишає зображення без змін. Значення між "0%" та "100%" є лінійними множниками (мультиплікаторами) ефекта. Якщо параметр ‘amount’ відсутній, використовується значення "0".

- -
filter: sepia(100%)
- - - -

{{EmbedLiveSample('sepia_example','100%','229px','')}}

- -

Combining functions

- -

Можна комбінувати будь-яку кількість функцій для маніпулювання рендерингом. Наступні приклади посилюють контрастність та яскравість зображення.

- -
filter: contrast(175%) brightness(103%)
- - - -

{{EmbedLiveSample('combination_example','100%','209px','')}}

- -

Specifications

- - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{ SpecName('Filters 1.0', '#FilterProperty', 'filter') }}{{ Spec2('Filters 1.0') }}Initial definition
- -

Browser compatibility

- -

{{CompatibilityTable}}

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support{{CompatChrome("18.0")}}{{property_prefix("-webkit")}}[1]{{CompatGeckoDesktop(35)}}[2]{{CompatNo}}[3]{{CompatOpera("15.0")}}{{property_prefix("-webkit")}}{{CompatSafari("6.0")}}{{property_prefix("-webkit")}}
On SVG Elements{{CompatNo}}[4]{{CompatGeckoDesktop(35)}}{{CompatNo}}{{CompatNo}}{{CompatNo}}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatAndroid("4.4")}}{{property_prefix("-webkit")}}{{CompatGeckoDesktop(35)}}[2]{{CompatNo}}22.0 {{CompatVersionUnknown}}{{property_prefix("-webkit")}} -

6.0 {{CompatVersionUnknown}}{{property_prefix("-webkit")}}

-
On SVG Elements{{CompatNo}}[4]{{CompatGeckoDesktop(35)}}{{CompatNo}}{{CompatNo}}{{CompatNo}}
-
- -

[1] У Chrome 18 to 19, функція saturate() приймає тільки цілі десяткові числа та відсоткові значання. Цей баг виправлений у Chrome 20 та наступних.

- -

[2] До Firefox 34, Gecko виконував тільки {{anch("url()")}} форму властивості filter; так як формування ланцюжка (chaining) тоді не було реалізовано, було дозволено тільки одне url() (або коли layout.css.filters.enabled pref було встановлене як false).

- -

Функціональні значення filter контролюються layout.css.filters.enabled pref і був доступним, але заборонений за замовчуванням у Firefox 34.

- -

[3] Internet Explorer з 4.0 по 9.0 виконував нестандартну властивіст filter. Синтаксис сильно відрізняється і не був тут задокументований.

- -

[4] У даний момент Blink не виконує дану властивість(feature). Дивіться bug 109224.

- -

See also

- - diff --git a/files/uk/web/css/flex-grow/index.html b/files/uk/web/css/flex-grow/index.html deleted file mode 100644 index 8c70a17578..0000000000 --- a/files/uk/web/css/flex-grow/index.html +++ /dev/null @@ -1,194 +0,0 @@ ---- -title: flex-grow -slug: Web/CSS/flex-grow -translation_of: Web/CSS/flex-grow ---- -
{{CSSRef}}
- -

Опис

- -

Властивість flex-grow CSS визначає яку частину вільного простору може зайняти дочірній flex елемент. Ця властивість встановлюється в одиницях відносних до інших контейнерів.

- -

{{cssinfo}}

- -

Можете більш детальніше довідатся як користуватись властивостями flex з наступної статті Using CSS flexible boxes

- -

Синтаксис

- -
/* <number> values */
-flex-grow: 3;
-flex-grow: 0.6;
-
-/* Global values */
-flex-grow: inherit;
-flex-grow: initial;
-flex-grow: unset;
-
- -

Значення

- -
-
<number>
-
Дивись {{cssxref("<number>")}}. Значення менші за 0 є недійсними.
-
- -

Formal syntax

- -{{csssyntax}} - -

Приклад

- -

HTML

- -
-
<h4>This is a Flex-Grow</h4>
-<h5>A,B,C and F are flex-grow:1 . D and E are flex-grow:2 .</h5>
-<div id="content">
-  <div class="box" style="background-color:red;">A</div>
-  <div class="box" style="background-color:lightblue;">B</div>
-  <div class="box" style="background-color:yellow;">C</div>
-  <div class="box1" style="background-color:brown;">D</div>
-  <div class="box1" style="background-color:lightgreen;">E</div>
-  <div class="box" style="background-color:brown;">F</div>
-</div>
-
- -

CSS

- -
#content {
-  -ms-box-orient: horizontal;
-  display: -webkit-box;
-  display: -moz-box;
-  display: -ms-flexbox;
-  display: -moz-flex;
-  display: -webkit-flex;
-  display: flex;
-
-  -webkit-justify-content: space-around;
-  justify-content: space-around;
-  -webkit-flex-flow: row wrap;
-  flex-flow: row wrap;
-  -webkit-align-items: stretch;
-  align-items: stretch;
-}
-
-.box {
-  flex-grow: 1;
-  border: 3px solid rgba(0,0,0,.2);
-}
-
-.box1 {
-  flex-grow: 2;
-  border: 3px solid rgba(0,0,0,.2);
-}
-
-
- -

Результат

- -

{{EmbedLiveSample('Example', '750px', '400px', '', 'Web/CSS/flex-grow')}}

- -

Специфікації

- - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('CSS3 Flexbox','#flex-grow','flex-grow')}}{{Spec2('CSS3 Flexbox')}}Initial definition
- -

Підтримка браузерів

- -

{{CompatibilityTable}}

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureFirefox (Gecko)ChromeEdgeInternet ExplorerOperaSafari
Базова підтримка{{CompatGeckoDesktop("18.0")}}[1]21.0{{property_prefix("-webkit")}}{{CompatVersionUnknown}}{{property_prefix("-webkit")}}
- {{CompatVersionUnknown}}
1112.106.1{{property_prefix("-webkit")}}
< 0 animate{{CompatGeckoDesktop("32.0")}}[2]49.0{{CompatUnknown}}{{CompatUnknown}}{{CompatNo}}{{CompatNo}}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureFirefox Mobile (Gecko)AndroidEdgeIE PhoneOpera MobileSafari Mobile
Базова підтримка{{CompatGeckoMobile("18.0")}}[1]{{CompatUnknown}}{{CompatVersionUnknown}}{{property_prefix("-webkit")}}
- {{CompatVersionUnknown}}
{{CompatNo}}12.10{{CompatNo}}
< 0 animate{{CompatGeckoDesktop("32.0")}}[2]{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatNo}}{{CompatNo}}
-
- -

[1] Firefox підтримує лише однострочні flexbox конструкції до версії Firefox 27. Щоб активувати підтримку flexbox властивостей, для Firefox 18 та 19, користувачу потрібно змінити параметр layout.css.flexbox.enabled на true у файлі налаштувань about:config.

- -

В додаток до непрефіксної підтримки, Gecko 48.0 {{geckoRelease("48.0")}} додана підтримка для -webkit префіксних варіацій властивостей для підтримки веб-сумісності, для цього потрібно змінити властивість layout.css.prefixes.webkit на true, яка за замовченням встановлена - false. Але з релізу Gecko 49.0 {{geckoRelease("49.0")}} ця властивість набуває значення true за замовченням.

- -

[2] До того як вийшла версія Firefox 32, Gecko не був в змозі анімувати знаяення які починалися чи закінчувалися на 0(SpecDemo).

- -

Дивись також

- - diff --git a/files/uk/web/css/flex/index.html b/files/uk/web/css/flex/index.html deleted file mode 100644 index f2205b145d..0000000000 --- a/files/uk/web/css/flex/index.html +++ /dev/null @@ -1,209 +0,0 @@ ---- -title: flex -slug: Web/CSS/flex -tags: - - CSS - - CSS Flexible Boxes - - CSS Властивість - - flexbox -translation_of: Web/CSS/flex ---- -
{{CSSRef}}
- -

Загальний огляд

- -

CSS параметр flex є скороченим записом властивості, котра визначає здатність flex елемента змінювати свої розміри аби заповнити наявний простір. Flex елементи можна розтягнути аби використати увесь наявний простір пропорційно до вказаного параметра flex-grow, або flex-shrink аби запобігти виходу за межі батьківського контейнера.

- -

{{cssinfo}}

- -

Перегляньте Використання гнучких CSS контейнерів для більш детальної інформації та опису властивостей.

- -

Синтаксис

- -
/* 0 0 auto */
-flex: none;
-
-/* Одне значення, ціле число: flex-grow (flex-basis змінюється на 0) */
-flex: 2;
-
-/* Одне значення, width/height: flex-basis */
-flex: 10em;
-flex: 30px;
-flex: auto;
-flex: content;
-
-/* Два значення: flex-grow | flex-basis */
-flex: 1 30px;
-
-/* Два значення: flex-grow | flex-shrink (flex-basis змінюється на 0) */
-flex: 2 2;
-
-/* Три значення: flex-grow | flex-shrink | flex-basis */
-flex: 2 2 10%;
-
-/* Глобальні значення */
-flex: inherit;
-flex: initial;
-flex: unset;
-
- -

Значення

- -
-
<'flex-grow'>
-
Визначає ширину flex елемента відносно ширин всіх сусідніх елементів. Перегляньте {{cssxref("<number>")}} задля детального опису. Від'ємні значення вважаються невірними. Приймає значення 1, коли воно не вказується явно.
-
<'flex-shrink'>
-
Визначає flex-shrink flex елемента. Перегляньте {{cssxref("<number>")}} задля детального опису. Від'ємні значення вважаються невірними. Приймає значення 1, коли воно не вказується явно.
-
<'flex-basis'>
-
Визначає  базис flex елемента. Може приймати будь-яке значення, з тих, що можуть приймати параметри width і height. Значення 0 має мати одиницю виміру, аби уникнути трактування його, як значення гнучкості. Приймає значення 0%, коли воно не вказується явно.
-
none
-
Ключове слово, котре по значенню рівне 0 0 auto.
-
-

Формальний синтаксис

-
-
- -{{csssyntax}} - -

Приклад

- -
#flex-container {
-	display: -webkit-flex;
-	display: flex;
-	-webkit-flex-direction: row;
-	flex-direction: row;
-}
-
-#flex-container > .flex-item {
-	-webkit-flex: auto;
-	flex: auto;
-}
-
-#flex-container > .raw-item {
-	width: 5rem;
-}
-
- -
<div id="flex-container">
-    <div class="flex-item" id="flex">Flex box (click to toggle raw box)</div>
-    <div class="raw-item" id="raw">Raw box</div>
-</div>
-
- - - -

Результат

- -

{{EmbedLiveSample('Example','100%','60')}}

- -

Специфікації

- - - - - - - - - - - - - - - - -
СпецифікаціяСтанКоментар
{{SpecName('CSS3 Flexbox', '#flex-property', 'flex')}}{{Spec2('CSS3 Flexbox')}}Загальне визначення
- -

Сумісність із браузерами

- -

{{CompatibilityTable()}}

- -
- - - - - - - - - - - - - - - - - - - -
ПідтримкаFirefox (Gecko)ChromeInternet ExplorerOperaSafari
Базова підтримка{{CompatGeckoDesktop("18.0")}}[1]
- {{CompatGeckoDesktop("20.0")}}
- {{CompatGeckoDesktop("28.0")}}[2]
21.0{{property_prefix("-webkit")}}
- 29.0
10.0{{property_prefix("-ms")}}[3]
- 11.0[3]
12.10 -

6.1{{property_prefix("-webkit")}}
- 9.0

-
-
- -
- - - - - - - - - - - - - - - - - - - -
ПідтримкаFirefox Mobile (Gecko)AndroidIE PhoneOpera MobileSafari Mobile
Базова підтримка{{CompatUnknown}}4.41112.107.1{{property_prefix("-webkit")}}
-
- -

[1] В Gecko 18.0 {{geckoRelease("18.0")}} та 19.0 {{geckoRelease("19.0")}} підтримка flexbox прихована за налаштуванням about:config пунктом layout.css.flexbox.enabled, котрий по замовчуванню - false

- -

[2] Багатостроковий flexbox підтримується починаючи з Gecko 28.0 {{geckoRelease("28.0")}}.

- -

В додаток до підтримки непрефіксованого flexbox, у Gecko 48.0 {{geckoRelease("48.0")}} додано підтримку -webkit префіксованої версії властивості з огляду на веб-сумісність з налаштуванням layout.css.prefixes.webkit, котре по замовчуванню дорівнює false. Починаючи з версії Gecko 49.0 {{geckoRelease("49.0")}} це налаштування дорівнює true.

- -

[3] Internet Explorer 10-11 (але не 12+) ігнорує вживання calc() у частині flex синтаксису, що відповідає за властивість flex-basis. Це можна обійти використанням не сокроченого, а повного запису цієї властивості. Перегляньте Flexbug #8 задля більш детального опису. Визначення flex зі значенням без одиниці виміру у частині, що відповідає за flex-basis вважається синтаксично не вірною у цих версіях, а тому її буде проігноровано. Виправити це можна - завжди додаючи одиницю виміру у частині властивості, що відповідає за flex-basis, скороченого запису flex. Перегляньте Flexbug #4 задля більш детільного опису.

- -

Також варто переглянути

- - diff --git a/files/uk/web/css/font-smooth/index.html b/files/uk/web/css/font-smooth/index.html deleted file mode 100644 index 97344e55bf..0000000000 --- a/files/uk/web/css/font-smooth/index.html +++ /dev/null @@ -1,85 +0,0 @@ ---- -title: font-smooth -slug: Web/CSS/font-smooth -translation_of: Web/CSS/font-smooth ---- -
{{ CSSRef }} {{ Non-standard_header }}
- -

font-smooth CSS властивість контролює застосування антиалайзингу коли відбувається рендеринг шрифта.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{{ Xref_cssinitial() }}auto
Застосовується довсіх елементів і згенерованого контенту
{{ Xref_cssinherited() }}yes
Відсоткивідносно розмірів шрифта батьківського елемента
Media{{ Xref_cssvisual() }}
{{ Xref_csscomputed() }}як зазначено в специфікації
- -

Синтаксис

- -
/* Keyword values */
-font-smooth: auto;
-font-smooth: never;
-font-smooth: always;
-
-/* <length> value */
-font-smooth: 2em;
-
- -
-

WebKit реалізує подібну властивість, але з різними значеннями: -webkit-font-smoothing. Це працює тільки на Mac OS X/macOS.

- - -
- -
-

Firefox реалізує подібну властивість, але з різними значеннями: -moz-osx-font-smoothing. Це працює тільки на Mac OS X/macOS.

- - -
- -

Специфікації

- -

В ранніх версіях згладжування (2002) шрифтів CSS3 Fonts було присутнє, але на даний момент font-smooth його було видалено і ця специфікація не відповідає стандартам.

- -

Сумісність з браузерами

- - - -

{{Compat("css.properties.font-smooth")}}

- -

Дивіться також

- - diff --git a/files/uk/web/css/font-weight/index.html b/files/uk/web/css/font-weight/index.html deleted file mode 100644 index b65007bb13..0000000000 --- a/files/uk/web/css/font-weight/index.html +++ /dev/null @@ -1,271 +0,0 @@ ---- -title: font-weight -slug: Web/CSS/font-weight -translation_of: Web/CSS/font-weight ---- -
{{CSSRef}}
- -

The font-weight CSS property specifies the weight (or boldness) of the font. The font weights available to you will depend on the {{cssxref("font-family")}} you are using. Some fonts are only available in normal and bold.

- -
{{EmbedInteractiveExample("pages/css/font-weight.html")}}
- - - -

Syntax

- -
/* Keyword values */
-font-weight: normal;
-font-weight: bold;
-
-/* Keyword values relative to the parent */
-font-weight: lighter;
-font-weight: bolder;
-
-/* Numeric keyword values */
-font-weight: 100;
-font-weight: 200;
-font-weight: 300;
-font-weight: 400;
-font-weight: 500;
-font-weight: 600;
-font-weight: 700;
-font-weight: 800;
-font-weight: 900;
-
-/* Global values */
-font-weight: inherit;
-font-weight: initial;
-font-weight: unset;
-
- -

The font-weight property is specified using a single keyword value from the list below.

- -

Values

- -
-
normal
-
Normal font weight. Same as 400.
-
bold
-
Bold font weight. Same as 700.
-
lighter
-
One font weight lighter than the parent element (among the available weights of the font).
-
bolder
-
One font weight heavier than the parent element (among the available weights of the font).
-
100, 200, 300, 400, 500, 600, 700, 800, 900
-
Numeric font weights for fonts that provide more than just normal and bold.
-
- -

Fallback weights

- -

If the exact weight given is unavailable, then the following heuristic is used to determine the weight actually rendered:

- - - -

This means that for fonts that provide only normal and bold100-500 are normal, and 600-900 are bold.

- -

Meaning of relative weights

- -

When lighter or bolder is specified, the following chart shows how the absolute font weight of the element is determined:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Inherited valuebolderlighter
100400100
200400100
300400100
400700100
500700100
600900400
700900400
800900700
900900700
- -

Common weight name mapping

- -

The numerical values (100 to 900) roughly correspond to the following common weight names:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ValueCommon weight name
100Thin (Hairline)
200Extra Light (Ultra Light)
300Light
400Normal (Regular)
500Medium
600Semi Bold (Demi Bold)
700Bold
800Extra Bold (Ultra Bold)
900Black (Heavy)
- -

Interpolation

- -

A font-weight value is interpolated via discrete steps (multiples of 100). The interpolation happens in real number space and is converted to an integer by rounding to the nearest multiple of 100, with values halfway between multiples of 100 rounded towards positive infinity.

- -

Formal syntax

- -{{csssyntax}} - -

Examples

- -

HTML

- -
<p>
-  Alice was beginning to get very tired of sitting by her sister on the
-  bank, and of having nothing to do: once or twice she had peeped into the
-  book her sister was reading, but it had no pictures or conversations in
-  it, 'and what is the use of a book,' thought Alice 'without pictures or
-  conversations?'
-</p>
-
-<div>I'm heavy<br/>
-  <span>I'm lighter</span>
-</div>
-
- -

CSS

- -
/* Set paragraph text to be bold. */
-p {
-  font-weight: bold;
-}
-
-/* Set div text to two steps heavier than
-   normal but less than a standard bold. */
-div {
- font-weight: 600;
-}
-
-/* Set span text to be one step lighter
-   than its parent. */
-span {
-  font-weight: lighter;
-}
- -

Result

- -

{{EmbedLiveSample("Examples","400","300")}}

- -

Specifications

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('CSS3 Fonts', '#font-weight-prop', 'font-weight')}}{{Spec2('CSS3 Fonts')}}No change.
{{SpecName('CSS3 Transitions', '#animatable-css', 'font-weight')}}{{Spec2('CSS3 Transitions')}}Defines font-weight as animatable.
{{SpecName('CSS2.1', 'fonts.html#propdef-font-weight', 'font-weight')}}{{Spec2('CSS2.1')}}No change.
{{SpecName('CSS1', '#font-weight', 'font-weight')}}{{Spec2('CSS1')}}Initial definition.
- -

{{cssinfo}}

- -

Browser compatibility

- - - -

{{Compat("css.properties.font-weight")}}

diff --git a/files/uk/web/css/grid-template-areas/index.html b/files/uk/web/css/grid-template-areas/index.html deleted file mode 100644 index 472a754d14..0000000000 --- a/files/uk/web/css/grid-template-areas/index.html +++ /dev/null @@ -1,181 +0,0 @@ ---- -title: grid-template-areas -slug: Web/CSS/grid-template-areas -translation_of: Web/CSS/grid-template-areas ---- -

grid-template-areas CSS властивість, що визначає іменовані {{glossary("grid areas")}}.

- -
{{EmbedInteractiveExample("pages/css/grid-template-areas.html")}}
- - - -

Ці області не відносяться до певного грід-елемента, але можуть посилатися з властивостей грід-розташування{{cssxref("grid-row-start")}}, {{cssxref("grid-row-end")}}, {{cssxref("grid-column-start")}}, {{cssxref("grid-column-end")}}, та їх скорочень {{cssxref("grid-row")}}, {{cssxref("grid-column")}}, і {{cssxref("grid-area")}}.

- -

Syntax

- -
/* Keyword value */
-grid-template-areas: none;
-
-/* <string> values */
-grid-template-areas: "a b";
-grid-template-areas: "a b b"
-                     "a c d";
-
-/* Global values */
-grid-template-areas: inherit;
-grid-template-areas: initial;
-grid-template-areas: unset;
-
- -

Values

- -
-
none
-
Грід-контейнер не визначає жодні іменовані грід-області.
-
{{cssxref("<string>")}}+
-
Ряд створюється для кожного окремого рядка, а колонка для кожної клітинки рядка. Декілька іменованих клітинок у рядках та поміж ними створюють одну іменовану грід-область, що об'єднує відповідні клітинки. Оголошення непридатне, якщо ці клітинки утворюють прямокутник.
-
- -

Formal syntax

- -{{csssyntax}} - -

Example

- -

HTML

- -
<section id="page">
-  <header>Header</header>
-  <nav>Navigation</nav>
-  <main>Main area</main>
-  <footer>Footer</footer>
-</section>
- -

CSS

- -
#page {
-  display: grid;
-  width: 100%;
-  height: 250px;
-  grid-template-areas: "head head"
-                       "nav  main"
-                       "nav  foot";
-  grid-template-rows: 50px 1fr 30px;
-  grid-template-columns: 150px 1fr;
-}
-
-#page > header {
-  grid-area: head;
-  background-color: #8ca0ff;
-}
-
-#page > nav {
-  grid-area: nav;
-  background-color: #ffa08c;
-}
-
-#page > main {
-  grid-area: main;
-  background-color: #ffff64;
-}
-
-#page > footer {
-  grid-area: foot;
-  background-color: #8cffa0;
-}
-
- -

Result

- -

{{EmbedLiveSample("Example", "100%", "250px")}}

- -

Specifications

- - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName("CSS3 Grid", "#propdef-grid-template-areas", "grid-template-areas")}}{{Spec2("CSS3 Grid")}}Initial definition
- -

{{cssinfo}}

- -

Browser compatibility

- - - -

{{Compat("css.properties.grid-template-areas")}}

- -

See also

- - - - diff --git a/files/uk/web/css/index.html b/files/uk/web/css/index.html deleted file mode 100644 index 50e7a47f9c..0000000000 --- a/files/uk/web/css/index.html +++ /dev/null @@ -1,92 +0,0 @@ ---- -title: CSS -slug: Web/CSS -tags: - - CSS - - CSS3 - - Layout - - Reference - - Веб - - Дизайн - - Стиль - - ЦСС - - каскадна - - оформлення - - сайтів - - сторінок - - таблиця -translation_of: Web/CSS ---- -

Каскадні таблиці стилів (CSS) - це мова стилів, яка використовується для опису представлення документу, написаного на HTML чи XML (включаючи XML діалекти такі, як SVG або XHTML). CSS описує як елементи повинні відображатися на екрані, на папері, при озвученні, або на інших пристроях.

- -

CSS є одною з основних мов відкритої мережі і має стандартизовану W3C специфікацію. Розроблена по рівнях, CSS1 в даний час застаріла, CSS2.1 є рекомендованою, і CSS3, яка тепер розділена на більш дрібні модулі та розвивається шляхом стандартизації.

- -
- - -
-
-

Посібники

- -

Наша CSS сфера навчання має декілька модулів, які дозволяють вивчити CSS з нуля — знання мови не вимагається.

- -
-
Вступ в CSS
-
Цей модуль дозволяє вам почати вивчення з базових понять як CSS працює, включаючи селектори і параметри, написання правил CSS, застосування CSS до HTML, як вказати довжину, колір та інші одиниці виміру в CSS, каскади і успадкування, основи блочної моделі та відлагоджування CSS.
-
Стилізація тексту
-
В даному модулі ми розглянемо основи стилізації тексту, включаючи налаштування шрифтів, товщини, курсиву, відстані між рядками і буквами, а також застосування тіней та інших можливостей стилізації тексту. Ми розглянемо в даному модулі використання власних шрифтів на вашій веб-сторінці, і стилізацію списків і посилань.
-
Стилізація блоків
-
Далі ми розглянемо стилізацію блоків, один з базових кроків у напрямку розбивання веб-сторінки на блоки. У данаму модулі ми підсумуємо блокову модель і тоді розглянемо методи контролю блоків, застосовуючи внутрішні відступи (padding), рамки (borders) і зовнішні відступи, застосування власних заливок фону, картинок та інших можливостей, і такої можливості, як падіння тіней і фільтрів на блоках.
-
Макети CSS
-
До цього моменту ми вже розглянули базові поняття CSS, як стилізувати текст, я як стилізувати і маніпулювати блоками, щоб ваш контент поміщався в середину даних блоків. Тепер час розглянути розташування ваших блоків у правильному місці, по відношенню до точки огляду, і відносно один одного. Ми розкрили необхідні передумови, тому тепер ми можемо заглибитися в шаблони CSS детальніше, подивитися на налаштування для різних дисплеїв, традиційні методи шаблонів, включаючи плавання елементів по сторінці (float) і позиціонування (positioning), і нові сучасні інструменти для шаблонів такі, як флексбокс (flexbox).
-
-
- -
-

Посилання

- - - -

Інструменти для CSS розробки

- - -
-
-
- -

Дивитися також

- - diff --git a/files/uk/web/css/layout_cookbook/index.html b/files/uk/web/css/layout_cookbook/index.html deleted file mode 100644 index 0af6191a71..0000000000 --- a/files/uk/web/css/layout_cookbook/index.html +++ /dev/null @@ -1,81 +0,0 @@ ---- -title: Кулінарна книга з CSS розмітки -slug: Web/CSS/Layout_cookbook -translation_of: Web/CSS/Layout_cookbook -original_slug: Web/CSS/Розмітка_кулінарна-книга ---- -
{{CSSRef}}
- -

The CSS layout cookbook aims to bring together recipes for common layout patterns, things you might need to implement in your own sites. In addition to providing code you can use as a starting point in your projects, these recipes highlight the different ways layout specifications can be used, and the choices you can make as a developer.

- -
-

Note: If you are new to CSS layout then you might first like to take a look at our CSS layout learning module, as this will give you the basic grounding you need to make use of the recipes here.

-
- -

The Recipes

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
RecipeDescriptionLayout Methods
Media objectsA two-column box with an image on one side and descriptive text on the other, e.g. a facebook post or tweet.CSS Grid, {{cssxref("float")}} fallback, {{cssxref("fit-content")}} sizing
ColumnsWhen to choose multi-column layout, flexbox or grid for your columns.CSS Grid, Multicol, Flexbox
Center an elementHow to center an item horizontally and vertically.Flexbox, Box Alignment
Sticky footersCreating a footer which sits at the bottom of the container or viewport when the content is shorter. CSS Grid, Flexbox
Split navigationA navigation pattern where some links are visually separated from the others.Flexbox, {{cssxref("margin")}}
Breadcrumb navigationCreating a list of links to allow the visitor to navigate back up through the page hierarchy.Flexbox
List group with badgesA list of items with a badge to display a count.Flexbox, Box Alignment
PaginationLinks to pages of content (such as search results).Flexbox, Box Alignment
CardA card component, which displays in a grid of cards.Grid Layout
Grid wrapperFor aligning grid content within a central wrapper, while also allowing items to break out.CSS Grid
- -

Contribute a Recipe

- -

As with all of MDN we would love you to contribute a recipe in the same format as the ones shown above. See this page for a template and guidelines for writing your own example.

diff --git a/files/uk/web/css/layout_mode/index.html b/files/uk/web/css/layout_mode/index.html deleted file mode 100644 index 504d11adc7..0000000000 --- a/files/uk/web/css/layout_mode/index.html +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: Схема компонування -slug: Web/CSS/Layout_mode -tags: - - CSS - - Компонування - - Розмітка - - Розташування -translation_of: Web/CSS/Layout_mode -original_slug: Web/CSS/Схема_компонування ---- -
Схема компонування (layout mode) в CSS являє собою алгоритм, який визначає розташування та розміри елементів залежно від того, як вони взаємодіють із сусідніми та батьківськими елементами. Існує декілька таких схем:
- - - -
-

Зауваження: Не всі властивості CSS застосовні до всіх схем компонування. Більшість із них вживаються разом з однією-двома схемами і жодним чином не діють, якщо відповідний елемент компонується за іншою схемою.

-
- -

Див. також

- - diff --git a/files/uk/web/css/linear-gradient()/index.html b/files/uk/web/css/linear-gradient()/index.html deleted file mode 100644 index cf11a60ebc..0000000000 --- a/files/uk/web/css/linear-gradient()/index.html +++ /dev/null @@ -1,208 +0,0 @@ ---- -title: linear-gradient() -slug: Web/CSS/linear-gradient() -translation_of: Web/CSS/linear-gradient() ---- -
{{CSSRef}}
- -

linear-gradient() CSS функція створює зображення, що складається з прогресивного переходу між двома або більше кольорами по прямій лінії. Резултатом буде об`єкт типу {{CSSxRef("<gradient>")}} , що є спеціальним видом {{CSSxRef("<image>")}}.

- -
{{EmbedInteractiveExample("pages/css/function-linear-gradient.html")}}
- - - -

Як і будь-який градієнт, лінійний градієнт не має внутрішніх розмірів; тобто він не має природного або бажаного розміру, а також кращого співвідношення. Його розмір буде відповідати розміру елемента, до якого він застосовується.

- -

Щоб створити лінійний градієнт, який повторюється так, щоб заповнити його контейнер, скористайтеся функцією {{CSSxRef("repeating-linear-gradient")}}.

- -

Оскільки <gradient> належить до типу даних <image>вони можуть використовуватися лише там, де можна використовувати <image>. З цієї причини linear-gradient() не працюватиме там де застосовуються такі властивості як {{CSSxRef("background-color")}} і інших властивостях, що використовують тип даних  {{CSSxRef("<color>")}}.

- -

Композиція лінійного градієнту

- -

Лінійний градієнт визначається віссю - градієнтною лінією та двома або більше точками зупинки кольорів. Кожна точка на осі - виразний колір; щоб створити плавний градієнт, функція linear-gradient() малює серію кольорових ліній, перпендикулярних лінії градієнта, кожна з яких відповідає кольору точки, де вона перетинає лінію градієнта.

- -

linear-gradient.png

- -

Лінія градієнта визначається центром коробки, що містить зображення градієнта, і кутом. Кольори градієнта визначаються двома або більше точками: початковою точкою, кінцевою точкою та між ними необов’язковими кольоровими точками зупинки.

- -

Початковою точкою є місце на лінії градієнта, де починається перший колір. Кінцевою точкою є точка, в якій закінчується останній колір. Кожна з цих двох точок визначається перетином лінії градієнта з перпендикулярною лінією, що проходить від кута коробки, який знаходиться в одному квадраті. Кінцеву точку можна просто зрозуміти як симетричну точку відліку. Ці дещо складні визначення призводять до цікавого ефекту, який іноді називають магічними кутами: кути, найближчі до початкової та кінцевої точок, мають той же колір, що і їхні відповідні початкові або кінцеві точки.

- -

Налаштування градієнтів

- -

Додавши більше точок зупинки кольорів у лінії градієнта, ви можете створити модифікований перехід між декількома кольорами. Позицію зупинки кольору можна чітко визначити, використовуючи {{CSSxRef("<length>")}} або {{CSSxRef("<percentage>")}}. Якщо ви не вказали розташування кольору, він розміщується на півдорозі між тим, що йому передує, і тим, що слідує за ним. Наступні два градієнти рівнозначні.

- -
linear-gradient(red, orange, yellow, green, blue);
-linear-gradient(red 0%, orange 25%, yellow 50%, green 75%, blue 100%);
- -

By default, colors transition smoothly from the color at one color stop to the color at the subsequent color stop, with the midpoint between the colors being the half way point between the color transition. You can move this midpoint to any position between two color stops by adding an unlabelled % color hint between the two colors to indicate where the middle of the color transition should be. The following example is solid red from the start to the 10% mark and solid blue from 90% to the end. Between 10% and 90% the color transitions from red to blue, however the midpoint of the transition is at the 30% mark rather than 50% as would have happened without the 30% color hint.

- -
linear-gradient(red 10%, 30%, blue 90%);
- -

Якщо дві або більше кольорових зупинки знаходяться в одному місці, переходом буде суцільна лінія між першим і останнім кольорами, задекларованими в цьому місці.  

- -

Кольорові зупинки повинні бути вказані у порядку зростання. Подальші зупинки кольорів з меншим значенням замінять значення попередньої зупинки кольору, створюючи жорсткий перехід. Наступні зміни від червоного до жовтого на позначці 30%, а потім переходи від жовтого до синього понад 35% градієнта

- -
linear-gradient(red 40%, yellow 30%, blue 65%);
-
- -

Допускається багатопозиційна зупинка кольору. Колір можна оголосити двома суміжними зупинками кольорів, задекларувавши обидві позиції в CSS. Наступні три градієнти еквівалентні:

- -
linear-gradient(red 0%, orange 10%, orange 30%, yellow 50%, yellow 70%, green 90%, green 100%);
-linear-gradient(red, orange 10% 30%, yellow 50% 70%, green 90%);
-linear-gradient(red 0%, orange 10% 30%, yellow 50% 70%, green 90% 100%);
- -

За замовчуванням, якщо немає кольору із зупинкою 0%, перший заявлений колір буде в цій точці. Аналогічно, останній колір буде продовжуватись до позначки 100%, або буде на позначці 100%, якщо на останній зупинці не було оголошено жодної довжини.

- -

Синтаксис

- -
/* A gradient tilted 45 degrees,
-   starting blue and finishing red */
-linear-gradient(45deg, blue, red);
-
-/* A gradient going from the bottom right to the top left corner,
-   starting blue and finishing red */
-linear-gradient(to left top, blue, red);
-
-/* Color stop: A gradient going from the bottom to top,
-   starting blue, turning green at 40% of its length,
-   and finishing red */
-linear-gradient(0deg, blue, green 40%, red);
-
-/* Color hint: A gradient going from the left to right,
-   starting red, getting to the midpoint color
-   10% of the way across the length of the gradient,
-   taking the rest of the 90% of the length to change to blue */
-linear-gradient(.25turn, red, 10%, blue);
-
-/* Multi-position color stop: A gradient tilted 45 degrees,
-   with a red bottom-left half and a blue top-right half,
-   with a hard line where the gradient changes from red to blue */
-linear-gradient(45deg, red 0 50%, blue 50% 100%);
- -

Values

- -
-
<side-or-corner>
-
Позиція стартової точки градієнта. Якщо її вказано починається зі слова to і до двох ключових слів: одне вказує горизонтальну сторону (left or right), а інше вертикальну сторону (top or bottom). Порядок бічних ключових слів не має значення. Якщо не вказано, він за замовчуванням буде to bottom .
-
Значення to top, to bottom, to left, і to right еквівалентні 0deg, 180deg, 270deg, і 90deg, відповідно. Інші значення конвертуються в значення кутів.
-
{{CSSxRef("<angle>")}}
-
Кут нахилу лінії градієнта . Значення 0deg еквівалентне to top; зростаючі значення обертаються за годинниковою стрілкою .
-
<linear-color-stop>
-
Кольорові зупинки {{CSSxRef("<color>")}} значення, з подальшим одним або двома опціональними положеннями точок зупинки, ( кожен з яких є або {{CSSxRef("<percentage>")}} або {{CSSxRef("<length>")}} по осі градієнта ).
-
<color-hint>
-
The color-hint is an interpolation hint defining how the gradient progresses between adjacent color stops. The length defines at which point between two color stops the gradient color should reach the midpoint of the color transition. If omitted, the midpoint of the color transition is the midpoint between two color stops.
-
-
-

Примітка: Rendering of color stops in CSS gradients follows the same rules as color stops in SVG gradients.

-
-
-
- -

Formal syntax

- -
linear-gradient(
-  [ <angle> | to <side-or-corner> ,]? <color-stop-list> )
-  \---------------------------------/ \----------------------------/
-    Definition of the gradient line        List of color stops
-
-where <side-or-corner> = [ left | right ] || [ top | bottom ]
-  and <color-stop-list> = [ <linear-color-stop> [, <color-hint>? ]? ]#, <linear-color-stop>
-  and <linear-color-stop> = <color> [ <color-stop-length> ]?
-  and <color-stop-length> = [ <percentage> | <length> ]{1,2}
-  and <color-hint> = [ <percentage> | <length> ]
- -

Приклади

- -

Градієнт під кутом 45 градусів

- - - -
body {
-  background: linear-gradient(45deg, red, blue);
-}
- -

{{EmbedLiveSample("Градієнт_під_кутом_45_градусів", 120, 120)}}

- -

Gradient that starts at 60% of the gradient line

- - - -
body {
-  background: linear-gradient(135deg, orange, orange 60%, cyan);
-}
- -

{{EmbedLiveSample("Gradient_that_starts_at_60_of_the_gradient_line", 120, 120)}}

- -

Градієнт з багатопозиційними точками зупинки

- -

У цьому прикладі використовуються багатопозиційні кольорові зупинки, причому сусідні кольори мають однакове значення стоп кольору, створюючи смугастий ефект.

- - - -
body {
-  background: linear-gradient(to right,
-     red 20%, orange 20% 40%, yellow 40% 60%, green 60% 80%, blue 80%);
-}
- -

{{EmbedLiveSample("Градієнт_з_багатопозиційними_точками_зупинки", 120, 120)}}

- -
-

Примітка: Please see Using CSS gradients for more examples.

-
- -

Специфікації

- - - - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('CSS4 Images', '#color-stop-syntax', 'Gradient Color-Stops')}}{{Spec2('CSS4 Images')}}Adds interpolation hints.
{{SpecName('CSS3 Images', '#linear-gradients', 'linear-gradient()')}}{{Spec2('CSS3 Images')}}Initial definition.
- -

Сумісність з браузерами

- - - -
{{Compat("css.types.image.gradient.linear-gradient")}}
- -

Дивіться також

- - diff --git a/files/uk/web/css/mozilla_extensions/index.html b/files/uk/web/css/mozilla_extensions/index.html deleted file mode 100644 index 649ee1de1a..0000000000 --- a/files/uk/web/css/mozilla_extensions/index.html +++ /dev/null @@ -1,680 +0,0 @@ ---- -title: CSS-розширення для Mozilla -slug: Web/CSS/Mozilla_Extensions -tags: - - CSS-розширення для Mozilla - - 'CSS: розширення Mozilla' - - нестандартні властивості - - нестандартні властивості CSS для Mozilla -translation_of: Web/CSS/Mozilla_Extensions ---- -
{{CSSRef}}
- -
- -

У таких додатках Mozilla, як Firefox, підтримується ряд спеціальних розширень Mozilla до CSS, включаючи властивості, значення, псевдо-елементи і псевдо-класи, at-правила і медіа-запити. Ці розширення мають префікс-moz-.

- -

Властивості і псевдокласи тільки для Mozilla (уникайте використання на веб-сайтах)

- -
-

Нотаток: Ці властивості і псевдокласи працюватимуть тільки в додатках Mozilla, таких як Firefox, і не працюють на стандартних технологічних схемах. Деякі з них можуть застосовуватися тільки до елементів XUL.

-
- -
-

B

- - - -

C–I

- - - -

O

- - - -

S–Z

- - -
- -

Колись патентовані властивості, які на даний час є стандартними

- -
-

Нотаток: Даби максимізувати сумісність вашого CSS, ви повинні використовувати непрефіксние стандартні властивості, а не префіксні, перераховані нижче. Як тільки задану властивість стандартизовано і реалізовано без префікса, префиксная версія, як правило, через деякий час видаляється.

-
- -
- -
- -

Значення властивостей

- -

Глобальні значення

- -
- -
- -

{{CSSxRef("-moz-appearance")}}

- -
- -
- -

{{CSSxRef("background-image")}}

- -
- -
- -

{{CSSxRef("border-color")}}

- -
- -
- -

{{CSSxRef("border-style")}} and {{CSSxRef("outline-style")}}

- -
- -
- -

{{CSSxRef("<color>")}} keywords

- -
- -
- -

{{CSSxRef("display")}}

- -
- -
- -

{{CSSxRef("empty-cells")}}

- -
- -
- -

{{CSSxRef("font")}}

- -
- -
- -

{{CSSxRef("font-family")}}

- -
- -
- -

{{CSSxRef("image-rendering")}}

- -
- -
- -

{{CSSxRef("<length>")}}

- -
- -
- -

{{CSSxRef("list-style-type")}}

- -
- -
- -

{{CSSxRef("overflow")}}

- -
- -
- -

{{CSSxRef("text-align")}}

- -
- -
- -

{{CSSxRef("text-decoration")}}

- -
- -
- -

{{CSSxRef("-moz-user-select")}}

- -
- -
- -

{{CSSxRef("width")}}, {{CSSxRef("min-width")}}, and {{CSSxRef("max-width")}}

- -
- -
- -

Псевдоелементи та псевдокласи

- -
- -
- -

At-правила

- -
- -
- -

Компоненти медіа запитів

- -
- -
- -

Інше

- -
- -
- -

Дивіться також

- - diff --git a/files/uk/web/css/order/index.html b/files/uk/web/css/order/index.html deleted file mode 100644 index 44839c5c2b..0000000000 --- a/files/uk/web/css/order/index.html +++ /dev/null @@ -1,170 +0,0 @@ ---- -title: order -slug: Web/CSS/order -tags: - - CSS - - CSS Flexible Boxes - - Порядок -translation_of: Web/CSS/order ---- -
{{CSSRef}}
- -

Загальний огляд

- -

CSS параметр order визначає порядок розташування flex елементів відносно їхнього батьківського flex контейнера. Елементи розташовуються у порядку зростання значення order. Елементи з однаковим значенням параметра order розташовуються в такому порядку, в якому вони розташовані в основному коді.

- -
-

Примітка: параметр order лише впливає на візуальний порядок елементів і не впливає на їх логічний порядок або порядок табуляції. order не повинен використовуватися на невізуальних носіях, таких як голосові читалки.

-
- -

{{cssinfo}}

- -

Дивіться Використання CSS flexible boxes для більш детальної інформації, а також опису інших параметрів.

- -

Синтаксис

- -
/* Числові значення включаючи від'ємні числа */
-order: 5;
-order: -5;
-
-/* Глобальні значення */
-order: inherit;
-order: initial;
-order: unset;
-
- -

Значення

- -
-
<integer>
-
Відображає порядковий номер групи, до якої flex елемент був присвоєний.
-
- -

Офіційний синтаксис

- -{{csssyntax}} - -

Приклади

- -

Тут є базовий уривок HTML:

- -
<!DOCTYPE html>
-<header>...</header>
-<div id='main'>
-   <article>Article</article>
-   <nav>Nav</nav>
-   <aside>Aside</aside>
-</div>
-<footer>...</footer>
- -

Наступний CSS код повинен створити класичний шаблон з двома бічними панелями, які оточують блок з контентом. Flexible Box Layout Module автоматично створює блоки з однаковими вертикальними розмірами і буде займати стільки горизонтального простору, скільки буде доступно.

- -
#main { display: flex;  text-align:center; }
-#main > article { flex:1;        order: 2; }
-#main > nav     { width: 200px;  order: 1; }
-#main > aside   { width: 200px;  order: 3; }
- -

Результат

- -

{{ EmbedLiveSample('Examples' ,'','','','Web/CSS/order') }}

- -

 

- -

Специфікації

- - - - - - - - - - - - - - - - -
СпецифікаціяСтатусКоментар
{{SpecName('CSS3 Flexbox', '#order-property', 'order')}}{{Spec2('CSS3 Flexbox')}}Початкове визначення
- -

Сумісність із браузерами

- -

{{CompatibilityTable}}

- -
- - - - - - - - - - - - - - - - - - - - - -
ОсобливістьChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari
Базова підтримка{{CompatChrome(21.0)}}{{property_prefix("-webkit")}}
- 29
{{CompatVersionUnknown}}{{property_prefix("-webkit")}}
- {{CompatVersionUnknown}}
{{CompatGeckoDesktop("18.0")}}[1]
- {{CompatGeckoDesktop("20.0")}}[2]
-

10.0{{property_prefix("-ms")}}[3]
- 11

-
12.107 {{property_prefix("-webkit")}}
- 9
-
- -
- - - - - - - - - - - - - - - - - - - - - - - -
ОсобливістьAndroidChrome for AndroidEdgeFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Базова підтримка{{CompatUnknown}}{{CompatUnknown}}{{CompatVersionUnknown}}{{property_prefix("-webkit")}}
- {{CompatVersionUnknown}}
{{CompatGeckoMobile("18.0")}}[1]
- {{CompatGeckoMobile("20.0")}}[2]
{{CompatUnknown}}12.107 {{property_prefix("-webkit")}}
- 9
-
- -

[1] Щоб активувати підтримку Flexbox для Firefox 18 або 19, користувач повинен змінити about:config preference layout.css.flexbox.enabled на true. Багаторядкові flexible boxes підтримуються з Firefox 28.

- -

Firefox на даний час неправильно змінює порядок табуляції елементів. Дивитися {{bug("812687")}}.

- -

[2] На додаток до підтримки без префікса, Gecko 48.0 {{geckoRelease("48.0")}} добавила підтримку для -webkit префіксної версії даного параметра, for web compatibility reasons behind the preference layout.css.prefixes.webkit, defaulting to false. Since Gecko 49.0 {{geckoRelease("49.0")}} the preference defaults to true.

- -

[3] В Internet Explorer 10, flexible контейнер декларуєтсья з використанням префікса '-ms' display:-ms-flexbox, а не display:flex. Даний параметр реалізований під нестандартним іменем -ms-flex-order.

- -

Дивитися також

- - diff --git a/files/uk/web/css/position/index.html b/files/uk/web/css/position/index.html deleted file mode 100644 index 2d057ef9cc..0000000000 --- a/files/uk/web/css/position/index.html +++ /dev/null @@ -1,461 +0,0 @@ ---- -title: position -slug: Web/CSS/position -tags: - - CSS - - CSS-властивість - - Розміщення -translation_of: Web/CSS/position ---- -
{{CSSRef}}
- -

CSS-властивість position вказує, як елемент розміщено в документі. А властивості {{Cssxref("top")}}, {{Cssxref("right")}}, {{Cssxref("bottom")}}, та {{Cssxref("left")}} визначають остаточне положення елемента.

- -
/* Keyword values */
-position: static;
-position: relative;
-position: absolute;
-position: fixed;
-position: sticky;
-
-/* Global values */
-position: inherit;
-position: initial;
-position: unset;
-
- -
- - - -{{EmbedLiveSample("position", 1200, 300, "", "", "example-outcome-frame")}}
- -

{{cssinfo}}

- -

Види розміщення

- - - -

Most of the time, absolutely positioned elements that have {{Cssxref("height")}} and {{Cssxref("width")}} set to auto are sized so as to fit their contents. However, non-replaced absolutely positioned elements can be made to fill the available vertical space by specifying both {{Cssxref("top")}} and {{Cssxref("bottom")}} and leaving {{Cssxref("height")}} unspecified (that is, auto). They can likewise be made to fill the available horizontal space by specifying both {{Cssxref("left")}} and {{Cssxref("right")}} and leaving {{Cssxref("width")}} as auto.

- -

Except for the case just described of absolutely positioned elements filling the available space:

- - - -

Синтаксис

- -

Значення властивості position може бути одним із ключових слів, що їх перелік наведено нижче.

- -

Значення

- -
-
static
-
The element is positioned according to the normal flow of the document. The {{cssxref("top")}}, {{cssxref("right")}}, {{cssxref("bottom")}}, {{cssxref("left")}}, and {{cssxref("z-index")}} properties have no effect. This is the default value.
-
relative
-
The element is positioned according to the normal flow of the document, and then offset relative to itself based on the values of top, right, bottom, and left. The offset does not affect the position of any other elements; thus, the space given for the element in the page layout is the same as if position were static. This value creates a new stacking context when the value of z-index is not auto. The effect of relative on table-*-group, table-row, table-column, table-cell, and table-caption elements is undefined.
-
absolute
-
The element is removed from the normal document flow; no space is created for the element in the page layout. Instead, it is positioned relative to its closest positioned ancestor if any; otherwise, it is placed relative to the initial containing block. Its final position is determined by the values of top, right, bottom, and left. This value creates a new stacking context when the value of z-index is not auto. Absolutely positioned boxes can have margins, and they do not collapse with any other margins.
-
fixed
-
The element is removed from the normal document flow; no space is created for the element in the page layout. Instead, it is positioned relative to the screen's viewport and doesn't move when scrolled. Its final position is determined by the values of top, right, bottom, and left. This value always creates a new stacking context. When an ancestor has the transform property set to something other than none, that ancestor is used as the container instead of the viewport (see CSS Transforms Spec). In printed documents, the element is placed in the same position on every page.
-
- -
-
sticky {{experimental_inline}}
-
The element is positioned according to the normal flow of the document, and then offset relative to its flow root and containing block based on the values of top, right, bottom, and left. The offset does not affect the position of any other elements. This value always creates a new stacking context. The effect of sticky on table-related elements is the same as relative. Note that sticky, by specification, will not work inside element with overflow: hidden or auto. (ref: Github issue on W3C CSSWG)
-
- -

Формальний синтаксис

- -{{csssyntax}} - -

Приклади

- -

Відносне розміщення

- -

Relatively positioned elements are offset a given amount from their normal position within the document, but without the offset affecting other elements. In the example below, note how the other elements are placed as if "Two" were taking up the space of its normal location.

- -

HTML

- -
<div class="box" id="one">One</div>
-<div class="box" id="two">Two</div>
-<div class="box" id="three">Three</div>
-<div class="box" id="four">Four</div>
-
- -

CSS

- -
.box {
-  display: inline-block;
-  width: 100px;
-  height: 100px;
-  background: red;
-  color: white;
-}
-
-#two {
-  position: relative;
-  top: 20px;
-  left: 20px;
-  background: blue;
-}
-
- -

{{ EmbedLiveSample('Relative_positioning', '600px', '200px') }}

- -

Абсолютне розміщення

- -

Elements that are relatively positioned remain in the normal flow of the document. In contrast, an element that is absolutely positioned is taken out of the flow; thus, other elements are positioned as if it did not exist. The absolutely positioned element is positioned relative to its nearest positioned ancestor (i.e., the nearest ancestor that is not static). If a positioned ancestor doesn't exist, the initial container is used. In the example below, box "Two" has no positioned ancestor, so it is positioned relative to the the <body> of the document.

- -

HTML

- -
<div class="box" id="one">One</div>
-<div class="box" id="two">Two</div>
-<div class="box" id="three">Three</div>
-<div class="box" id="four">Four</div>
- -

CSS

- -
.box {
-  display: inline-block;
-  width: 100px;
-  height: 100px;
-  background: red;
-  color: white;
-}
-
-#two {
-  position: absolute;
-  top: 20px;
-  left: 20px;
-  background: blue;
-}
- -

{{ EmbedLiveSample('Absolute_positioning', '800px', '200px') }}

- -

Нерухоме розміщення

- -

Fixed positioning is similar to absolute positioning, with the exception that the element's containing block is the viewport. This can be used to create a floating element that stays in the same position regardless of scrolling. In the example below, box "One" is fixed at 80 pixels from the top of the page and 10 pixels from the left. Even after scrolling, it remains in the same place relative to the viewport.

- -

HTML

- -
<div class="outer">
-  <p>
-    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam congue tortor eget pulvinar lobortis.
-    Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nam ac dolor augue.
-    Pellentesque mi mi, laoreet et dolor sit amet, ultrices varius risus. Nam vitae iaculis elit.
-    Aliquam mollis interdum libero. Sed sodales placerat egestas. Vestibulum ut arcu aliquam purus viverra dictum vel sit amet mi.
-    Duis nisl mauris, aliquam sit amet luctus eget, dapibus in enim. Sed velit augue, pretium a sem aliquam, congue porttitor tortor.
-    Sed tempor nisl a lorem consequat, id maximus erat aliquet. Sed sagittis porta libero sed condimentum.
-    Aliquam finibus lectus nec ante congue rutrum. Curabitur quam quam, accumsan id ultrices ultrices, tempor et tellus.
-  </p>
-  <p>
-    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam congue tortor eget pulvinar lobortis.
-    Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nam ac dolor augue.
-    Pellentesque mi mi, laoreet et dolor sit amet, ultrices varius risus. Nam vitae iaculis elit.
-    Aliquam mollis interdum libero. Sed sodales placerat egestas. Vestibulum ut arcu aliquam purus viverra dictum vel sit amet mi.
-    Duis nisl mauris, aliquam sit amet luctus eget, dapibus in enim. Sed velit augue, pretium a sem aliquam, congue porttitor tortor.
-    Sed tempor nisl a lorem consequat, id maximus erat aliquet. Sed sagittis porta libero sed condimentum.
-    Aliquam finibus lectus nec ante congue rutrum. Curabitur quam quam, accumsan id ultrices ultrices, tempor et tellus.
-  </p>
-  <div class="box" id="one">One</div>
-</div>
-
- -

CSS

- -
.box {
-  width: 100px;
-  height: 100px;
-  background: red;
-  color: white;
-}
-
-#one {
-  position: fixed;
-  top: 80px;
-  left: 10px;
-  background: blue;
-}
-
-.outer {
-  width: 500px;
-  height: 300px;
-  overflow: scroll;
-  padding-left: 150px;
-}
-
- -

{{ EmbedLiveSample('Fixed_positioning', '800px', '300px') }}

- -

«Липке» розміщення

- -

Sticky positioning can be thought of as a hybrid of relative and fixed positioning. A stickily positioned element is treated as relatively positioned until it crosses a specified threshold, at which point it is treated as fixed. For instance...

- -
#one { position: sticky; top: 10px; }
- -

...would position the element with id one relatively until the viewport were scrolled such that the element would be less than 10 pixels from the top. Beyond that threshold, the element would be fixed to 10 pixels from the top.

- -
A common use for sticky positioning is for the headings in an alphabetized list. The "B" heading will appear just below the items that begin with "A" until they are scrolled offscreen. Rather than sliding offscreen with the rest of the content, the "B" heading will then remain fixed to the top of the viewport until all the "B" items have scrolled offscreen, at which point it will be covered up by the "C" heading, and so on.
- -
 
- -
You must specify a threshold with at least one of top, right, bottom, or left for sticky positioning to behave as expected. Otherwise, it will be indistinguishable from relative positioning.
- -
 
- -

HTML

- -
<dl>
-  <div>
-    <dt>A</dt>
-    <dd>Andrew W.K.</dd>
-    <dd>Apparat</dd>
-    <dd>Arcade Fire</dd>
-    <dd>At The Drive-In</dd>
-    <dd>Aziz Ansari</dd>
-  </div>
-  <div>
-    <dt>C</dt>
-    <dd>Chromeo</dd>
-    <dd>Common</dd>
-    <dd>Converge</dd>
-    <dd>Crystal Castles</dd>
-    <dd>Cursive</dd>
-  </div>
-  <div>
-    <dt>E</dt>
-    <dd>Explosions In The Sky</dd>
-  </div>
-  <div>
-    <dt>T</dt>
-    <dd>Ted Leo &amp; The Pharmacists</dd>
-    <dd>T-Pain</dd>
-    <dd>Thrice</dd>
-    <dd>TV On The Radio</dd>
-    <dd>Two Gallants</dd>
-  </div>
-</dl>
-
- -

CSS

- -
* {
-  box-sizing: border-box;
-}
-
-dl > div {
-  background: #FFF;
-  padding: 24px 0 0 0;
-}
-
-dt {
-  background: #B8C1C8;
-  border-bottom: 1px solid #989EA4;
-  border-top: 1px solid #717D85;
-  color: #FFF;
-  font: bold 18px/21px Helvetica, Arial, sans-serif;
-  margin: 0;
-  padding: 2px 0 0 12px;
-  position: -webkit-sticky;
-  position: sticky;
-  top: -1px;
-}
-
-dd {
-  font: bold 20px/45px Helvetica, Arial, sans-serif;
-  margin: 0;
-  padding: 0 0 0 12px;
-  white-space: nowrap;
-}
-
-dd + dd {
-  border-top: 1px solid #CCC;
-}
-
- -

{{ EmbedLiveSample('Sticky_positioning', '500px', '300px') }}

- - - -

Специфікації

- - - - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('CSS2.1', 'visuren.html#propdef-position', 'position')}}{{Spec2('CSS2.1')}} 
{{SpecName('CSS3 Positioning','#position-property','position')}}{{Spec2('CSS3 Positioning')}}Adds sticky property value.
- -

Підтримка веб-переглядачами

- -
{{CompatibilityTable}}
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support{{CompatChrome(1)}}{{CompatVersionUnknown}}1.0 (1.0) [1]4.0 [3]4.01.0 (85)
fixed value{{CompatChrome(1)}}{{CompatVersionUnknown}}1.0 (1.0) [4]7.04.01.0 (85)
sticky value{{CompatChrome(56)}}{{CompatUnknown}} [5]32 (32.0) [2]{{CompatNo}}{{CompatVersionUnknown}}6.1 {{ property_prefix("-webkit-") }}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - -
FeatureAndroid WebviewChrome for AndroidEdgeFirefox Mobile (Gecko)IE PhoneOpera MobileSafari Mobile
Basic support{{CompatChrome(1)}}{{CompatChrome(1)}}{{CompatVersionUnknown}}1.0 (1.0) [1]{{CompatUnknown}}{{CompatVersionUnknown}}7.0 {{ property_prefix("-webkit-") }}
-
- -

[1] Since Firefox 30, Gecko allows {{HTMLElement("tr")}}, {{HTMLElement("thead")}}, and  {{HTMLElement("tfoot")}} elements with a position: relative; style to act as absolute positioning containers. This means that a position: absolute; styled element inside the table can be positioned relative to these elements. In other browsers and in older versions of Firefox, setting position: relative; on a table row or row group has no effect. Firefox helps developers transition to the new behavior and detect any rendering issues it may cause on their sites by printing a warning to the JavaScript console if you use this feature: Relative positioning of table rows and row groups is now supported. This site may need to be updated because it may depend on this feature having no effect.

- -

[2] In Firefox 26 to Firefox 31 (inclusive), sticky positioning only works when the about:config preference layout.css.sticky.enabled is set to true. From Firefox 27 to 31, true is the default value for Nightly and Aurora versions of the browser. The preference has been removed in Firefox 48.

- -

[3] In Internet Explorer, fixed positioning doesn't work if the document is in quirks mode.

- -

[4] Prior to Firefox 44, position: fixed didn't create a stacking context in most cases. The specification, and Gecko implementation, have been modified to mimic Chrome and Safari's long-time behavior.

- -

[5] Sticky positioning is in preview for Edge.

diff --git a/files/uk/web/css/reference/index.html b/files/uk/web/css/reference/index.html deleted file mode 100644 index 1eb6730f98..0000000000 --- a/files/uk/web/css/reference/index.html +++ /dev/null @@ -1,189 +0,0 @@ ---- -title: CSS довідник -slug: Web/CSS/Reference -translation_of: Web/CSS/Reference -original_slug: Web/CSS/Довідник ---- -

This CSS Reference shows the basic syntax of a CSS rule; lists all standard CSS properties, pseudo-classes and pseudo-elements, @-rules, units, and selectors, all together in alphabetical order, as well as just the selectors by type; and allows you to quickly access detailed information for each of them. It not only lists the CSS 1 and CSS 2.1 properties, but also is a CSS3 reference that links to any CSS3 property and concept standardized, or already stabilized.  Also included is a brief DOM-CSS / CSSOM reference.

- -

Note that CSS rule-definitions are entirely (ASCII) text-based, whereas DOM-CSS / CSSOM, the rule-management system, is object-based.

- -

See also Mozilla CSS Extensions for Gecko-specific properties prefixed with -moz; and WebKit CSS Extensions for WebKit-specific properties. See Vendor-prefixed CSS Property Overview by Peter Beverloo for all prefixed properties.

- -

Basic rule syntax

- -

Be warned that any syntax error in a rule definition will invalidate the entire rule.

- -

Style rules

- -
selectorlist { property: value; [more property:value; pairs] }
-
-...where selectorlist is: selector[:pseudo-class] [::pseudo-element] [, more selectorlists]
-
-See selector, pseudo-element, pseudo-class lists below.
-
- -

Examples

- -
strong { color: red;}
-div.menu-bar li:hover > ul { display: block; }
-
- -

More about examples: #1, #2

- -

@rules

- -

As these have so many different structure-formats, see the desired At-rule for syntax.

- -

Keyword index

- -
{{CSS_Ref}}
- -
-
-

Selectors

- -
    -
  • Basic Selectors - -
  • -
  • Combinators    (more info) - -
  • -
  • Pseudo-elements    (more info) -
      -
    • {{ Cssxref("::after") }}
    • -
    • {{ Cssxref("::before") }}
    • -
    • {{ Cssxref("::first-letter") }}
    • -
    • {{ Cssxref("::first-line") }}
    • -
    • {{ Cssxref("::selection") }}
    • -
    • {{ Cssxref("::backdrop") }}
    • -
    • {{ Cssxref("::placeholder") }} {{experimental_inline}}
    • -
    • {{ Cssxref("::marker") }} {{experimental_inline}}
    • -
    • {{ Cssxref("::spelling-error") }} {{experimental_inline}}
    • -
    • {{ Cssxref("::grammar-error") }} {{experimental_inline}}
    • -
    -
  • -
  • Standard pseudo-classes    (more info) -
    -
      -
    • {{ Cssxref(":active") }}
    • -
    • {{ cssxref(':any')}}
    • -
    • {{ Cssxref(":checked") }}
    • -
    • {{ Cssxref(":default") }}
    • -
    • {{ Cssxref(":dir", ":dir()")}}
    • -
    • {{ Cssxref(":disabled") }}
    • -
    • {{ Cssxref(":empty") }}
    • -
    • {{ Cssxref(":enabled") }}
    • -
    • {{ Cssxref(":first") }}
    • -
    • {{ Cssxref(":first-child") }}
    • -
    • {{ Cssxref(":first-of-type") }}
    • -
    • {{ Cssxref(":fullscreen") }}
    • -
    • {{ Cssxref(":focus") }}
    • -
    • {{ Cssxref(":hover") }}
    • -
    • {{ Cssxref(":indeterminate") }}
    • -
    • {{ Cssxref(":in-range") }}
    • -
    • {{ Cssxref(":invalid") }}
    • -
    • {{ Cssxref(":lang", ":lang()") }}
    • -
    • {{ Cssxref(":last-child") }}
    • -
    • {{ Cssxref(":last-of-type") }}
    • -
    • {{ Cssxref(":left") }}
    • -
    • {{ Cssxref(":link") }}
    • -
    • {{ Cssxref(":not", ":not()") }}
    • -
    • {{ Cssxref(":nth-child", ":nth-child()") }}
    • -
    • {{ Cssxref(":nth-last-child", ":nth-last-child()") }}
    • -
    • {{ Cssxref(":nth-last-of-type", ":nth-last-of-type()") }}
    • -
    • {{ Cssxref(":nth-of-type", ":nth-of-type()") }}
    • -
    • {{ Cssxref(":only-child") }}
    • -
    • {{ Cssxref(":only-of-type") }}
    • -
    • {{ Cssxref(":optional") }}
    • -
    • {{ Cssxref(":out-of-range") }}
    • -
    • {{ Cssxref(":read-only") }}
    • -
    • {{ Cssxref(":read-write") }}
    • -
    • {{ Cssxref(":required") }}
    • -
    • {{ Cssxref(":right") }}
    • -
    • {{ Cssxref(":root") }}
    • -
    • {{ Cssxref(":scope") }}
    • -
    • {{ Cssxref(":target") }}
    • -
    • {{ Cssxref(":valid") }}
    • -
    • {{ Cssxref(":visited") }}
    • -
    -
    -
  • -
- -

A complete list of selectors in the Selectors Level 3 specification.

- -

CSS3 Tutorials

- -

These small how-to pages describe new technologies appeared in CSS3, or in CSS2.1 but with low support until recently:

- - - -

Concepts

- - - -

DOM-CSS / CSSOM

- -

Major object types:

- - - -

Important methods:

- -
    -
  • {{domxref("CSSStyleSheet.insertRule")}}
  • -
  • {{domxref("CSSStyleSheet.deleteRule")}}
  • -
-
-
diff --git a/files/uk/web/css/resize/index.html b/files/uk/web/css/resize/index.html deleted file mode 100644 index 7a11fcc18c..0000000000 --- a/files/uk/web/css/resize/index.html +++ /dev/null @@ -1,212 +0,0 @@ ---- -title: resize -slug: Web/CSS/resize -tags: - - CSS - - CSS Властивість - - Зміна розміру - - Розмір -translation_of: Web/CSS/resize ---- -
{{CSSRef}}
- -

Зведення

- -

The resize CSS property lets you control the resizability of an element.

- -

{{cssinfo}}

- -

Синтаксис

- -
/* Keyword values */
-resize: none;
-resize: both;
-resize: horizontal;
-resize: vertical;
-resize: block;
-resize: inline;
-
-/* Global values */
-resize: inherit;
-resize: initial;
-resize: unset;
-
- -

Значення

- -
-
none
-
The element offers no user-controllable method for resizing the element.
-
both
-
The element displays a mechanism for allowing the user to resize the element, which may be resized both horizontally and vertically.
-
horizontal
-
The element displays a mechanism for allowing the user to resize the element, which may only be resized horizontally.
-
vertical
-
The element displays a mechanism for allowing the user to resize the element, which may only be resized vertically.
-
block {{experimental_inline}}
-
Depending on the {{cssxref("writing-mode")}} and {{cssxref("direction")}} value, the element displays a mechanism for allowing the user to resize the element either horizontally or vertically in block direction.
-
inline {{experimental_inline}}
-
Depending on the {{cssxref("writing-mode")}} and {{cssxref("direction")}} value, the element displays a mechanism for allowing the user to resize the element either horizontally or vertically in inline direction.
-
- -
Note: resize does not apply to blocks for which the {{cssxref("overflow")}} property is set to visible.
- -

Formal syntax

- -{{csssyntax}} - -

Examples

- -

Disabling resizability of textareas

- -

CSS

- -

By default, {{HTMLElement("textarea")}} elements are resizable in {{gecko("2.0")}} (Firefox 4). You may override this behavior with the CSS shown below:

- -
textarea.example {
-  resize: none; /* disables resizability */
-}
-
- -

HTML

- -
<textarea class="example">Type some text here.</textarea>
- -

Result

- -

{{EmbedLiveSample("Disabling_resizability_of_textareas","200","100")}}

- -

Using resize with arbitrary elements

- -

You can use the resize property to make any element resizable. In the example below, a resizable {{HTMLElement("div")}} box contains a resizable paragraph ({{HTMLElement("p")}} element):

- -

CSS

- -
.resizable {
-  resize: both;
-  overflow: scroll;
-  border: 1px solid black;
-}
-
-div {
-  height: 300px;
-  width: 300px;
-}
-
-p {
-  height: 200px;
-  width: 200px;
-}
-
- -

HTML

- -
<div class="resizable">
-  <p class="resizable">
-    This paragraph is resizable, because the CSS resize property is set to 'both' on this
-    element.
-  </p>
-</div>
-
- -

Result

- -

{{EmbedLiveSample("Using_resize_with_arbitrary_elements","450","450")}}

- -

Specifications

- - - - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('CSS Logical Properties', '#resize', 'resize')}}{{Spec2('CSS Logical Properties')}}Adds the values block and inline.
{{SpecName('CSS3 Basic UI', '#resize', 'resize')}}{{Spec2('CSS3 Basic UI')}}Initial definition
- -

Browser compatibility

- -
{{CompatibilityTable}}
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support (on {{HTMLElement("textarea")}})1.0{{CompatGeckoDesktop("2.0")}}{{property_prefix("-moz")}}{{CompatNo}}12.13.0 (522)
On any block-level and replaced element, table cell, and inline block element (unless {{cssxref("overflow")}} is visible)4.0{{CompatGeckoDesktop("5.0")}}[1]{{CompatNo}}154.0
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidFirefox Mobile (Gecko)IE PhoneOpera MobileSafari Mobile
Basic support (on {{HTMLElement("textarea")}}){{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
On any block-level and replaced element, table cell, and inline block element (unless {{cssxref("overflow")}} is visible){{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
- -

[1] resize doesn't have any effect on {{HTMLElement("iframe")}} (cf. {{bug(680823)}})

- -

See also

- - diff --git a/files/uk/web/css/visual_formatting_model/index.html b/files/uk/web/css/visual_formatting_model/index.html deleted file mode 100644 index 521725152a..0000000000 --- a/files/uk/web/css/visual_formatting_model/index.html +++ /dev/null @@ -1,226 +0,0 @@ ---- -title: Модель візуального формування -slug: Web/CSS/Visual_formatting_model -tags: - - CSS - - NeedsUpdate - - Коробчаста модель CSS -translation_of: Web/CSS/Visual_formatting_model -original_slug: Web/CSS/Модель_візуального_формування ---- -

Модель візуального форматування (visual formatting model) у CSS являє собою алгоритм, що обробляє документ та подає його на візуальному носії. Ця модель є основним поняттям CSS.

- -

Кожен елемент в документі зазнає перетворення згідно з моделлю візуального формування і породжує нуль (жодного), один або кілька прямокутників відповідно до {{cssxref("CSS_Box_Model/Introduction_to_the_CSS_box_model", "коробчастої моделі")}} CSS. Компонування кожного такого прямокутника визначається низкою чинників:

- - - -

Відповідно до моделі, прямокутник розміщується й малюється відносно краю блока, всередині якого він міститься. Зазвичай прямокутник утворює такий блок для своїх нащадків. Втім, розмір прямокутника не обмежено розмірами блока, що його містить; коли компонування прямокутника передбачає вихід за межі блока, це зветься {{cssxref("overflow", "переповненням")}}.

- -

Утворення прямокутників

- -

Генерація блоків, це частина візуального форматування CSS, що створює прямокутники з елементів документу. Сгенеровані блоки є різних типів, що вплиає на те, як виконується візуальне формування. Тип згенерованого блоку залежить від значення CSS {{ cssxref("display") }}.

- -

Block-level elements and block boxes

- -

Елемент  називається блочним, коли його вираховане значення  {{ cssxref("display") }} CSS property is: block, list-item, or table. Елемент рівня блоку візуально форматується, як блок (наприклад абзац), приздачений для вертикальної компановки.

- -

Each block-level box participates in a block formatting context. Each block-level element generates at least one block-level box, called the principal block-level box. Some elements, like a list-item element, generating further boxes to handle bullets and other typographic elements introducing the list item, may generate more boxes. Most generate only the principal, block-level box.

- -

The principal block-level box contains descendant-generated boxes and generated content. It is also the box involved in the positioning scheme.

- -

venn_blocks.pngA block-level box may also be a block container box. A block container box is a box that contains only other block-level boxes, or creates an inline formatting context, thus containing only inline boxes.

- -

It is important to note that the notions of a block-level box and block container box are disjoined. The first, describes how the box behaves with its parents and sibling. The second, how it interacts with its descendants. Some block-level boxes, like tables, aren't block container boxes. Reciprocally, some block container boxes, like non-replaced inline blocks and non-replaced table cells, aren't block-level boxes.

- -

Block-level boxes that also are block container boxes are called block boxes.

- -

Anonymous block boxes

- -

In some cases, the visual formatting algorithm needs to add supplementary boxes. Because CSS selectors cannot style or name these boxes, they are called anonymous boxes.

- -

Because selectors do not work with anonymous boxes, they cannot be styled via a stylesheet. This means that all inheritable CSS properties have the inherit value, and all non-inheritable CSS properties, have the initial value.

- -

Block containing boxes contain only inline-level boxes, or only block-level boxes. But often the document contains a mix of both. In that case, anonymous block boxes are created around adjacent inline-level boxes.

- -

Example

- -

If we take the following HTML code (with default styling applied to it, that is {{ HTMLElement("div") }} and {{ HTMLElement("p") }} elements have display:block :

- -
<div>Some inline text <p>followed by a paragraph</p> followed by more inline text.</div>
- -

Two anonymous block boxes are created: one for the text before the paragraph (Some inline text), and another for the text after it (followed by more inline text). This builds the following block structure:

- -

anonymous_block-level_boxes.png

- -

Leading to:

- -
Some inline text
-followed by a paragraph
-followed by more inline text.
-
- -

Unlike the {{ HTMLElement("p") }} element's box, Web developers cannot control the style of the two anonymous boxes. Inheritable properties take the value from the {{ HTMLElement("div") }}'s property value, like {{ cssxref("color") }} to define the color of the text, and set the others to the initial value. For example, they won't have a specific {{ cssxref("background-color") }}, it is always transparent, the initial value for that property, and thus the background of the <div> is visible. A specific background color can be applied to the <p> box. Similarly, the two anonymous boxes always use the same color for their text.

- -

Another case that leads to the creation of anonymous block boxes, is an inline box that contains one or several block boxes. In that case, the box containing the block box is split into two inline boxes: one before, and one after the block box. All the inline boxes before the block box are then enclosed into an anonymous block box, so are the inline boxes following the block box. Therefore, the block box becomes the sibling of the two anonymous block boxes containing the inline elements.

- -

If there are several block boxes, without inline content in-between, the anonymous block boxes are created before, and after the set of boxes.

- -

Example

- -

If we take the following HTML code, with {{ HTMLElement("p") }} have display:inline and {{ HTMLElement("span") }} have display:block :

- -
<p>Some <em>inline</em> text <span>followed by a paragraph</span> followed by more inline text.</p>
- -

Two anonymous block boxes are created, one for the text before the span Element (Some inline text) and one for the text after it (followed by more inline text), which gives the following block structure:

- -

- -

Which leads to:

- -
Some inline text
-followed by a paragraph
-followed by more inline text.
-
- -

Inline-level elements and inline boxes

- -

An element is said to be inline-level when the calculated value of its {{ cssxref("display") }} CSS property is: inline, inline-block or inline-table. Visually, it doesn't constitute blocks of contents, but is distributed in lines with other inline-level content. Typically, the content of a paragraph with different formatting, like emphasis or images, is made from inline-level elements.

- -

venn_inlines.png

- -
-

This diagram uses outdated terminology; see note below. Besides that, it is incorrect because the yellow ellipsis on the right side is per definition either identical to the one on the left side, or bigger than that (it could be a mathematical superset), because the spec says "Inline-level elements generate inline-level boxes, which are boxes that participate in an inline formatting context", see CSS 2.2, chapter 9.2.2

-
- -

Inline-level elements generate inline-level boxes that are defined as boxes participating to an inline formatting context. Inline boxes are both inline-level boxes and boxes, whose contents participate in their container's inline formatting context. This is the case, for example, for all non-replaced boxes with display:inline. Inline-level boxes, whose contents do not participate in an inline formatting context, are called atomic inline-level boxes. These boxes, generated by replaced inline-level elements or by elements with a calculated {{ cssxref("display") }} value of inline-block or inline-table, are never split into several boxes, as is possible with inline boxes.

- -
Note: Initially, atomic inline-level boxes were called atomic inline boxes. This was unfortunate, as they are not inline boxes. This was corrected in an erratum to the spec. Nevertheless, you can harmlessly read atomic inline-level box each time you meet atomic inline box in the literature, as this is only a name change.
- -
Atomic inline boxes cannot be split into several lines in an inline formatting context. -
-
<style>
-  span {
-    display:inline; /* default value*/
-  }
-</style>
-<div style="width:20em;">
-   The text in the span <span>can be split in several
-   lines as it</span> is an inline box.
-</div>
-
- -

which leads to:

- -
The text in the span can be split into several lines as it is an inline box.
- -
<style>
-  span {
-    display:inline-block;
-  }
-</style>
-<div style="width:20em;">
-   The text in the span <span>cannot be split in several
-   lines as it</span> is an inline-block box.
-</div>
-
- -

which leads to:

- -
The text in the span cannot be split into several lines as it is an inline-block box.
-
-
- -

Anonymous inline boxes

- -

As for block boxes, there are a few cases where inline boxes are created automatically by the CSS engine. These inline boxes are also anonymous as they cannot be named by selectors; they inherit the value of all inheritable properties, setting it to initial for all others.

- -

The most common case where an anonymous inline box is created, is when some text is found as a direct child of a block box creating an inline formatting context. In that case, this text is included in the largest possible anonymous inline box. Also, space content, which would be removed by the behavior set in the {{ cssxref("white-space") }} CSS property, does not generate anonymous inline boxes because they would end empty.

- -
Example TBD
- -

Other types of boxes

- -

Line boxes

- -

Line boxes are generated by the inline formatting context to represent a line of text. Inside a block box, a line box extends from one border of the box to the other. When there are floats, the line box starts at the rightmost border of the left floats and ends at the leftmost border of the right floats.

- -

These boxes are technical, and Web authors do not usually have to bother with them.

- -

Run-in boxes

- -

Run-in boxes, defined using display:run-in, are boxes that are either block boxes or inline boxes, depending on the type of the following box. They can be used to create a title that runs inside its first paragraph when possible.

- -
Note: Run-in boxes were removed from the CSS 2.1 standard, as they were insufficiently specified to allow for interoperable implementation. They may reappear in CSS3, but meanwhile, are considered experimental. They should not be used in production.
- -

Model-induced boxes

- -

Besides the inline and block formatting contexts, CSS specifies several additional content models that may be applied to elements. These additional models, used to describe specific layouts, may define additional box types:

- - - -

Positioning schemes

- -

Once boxes are generated, the CSS engine needs to position them on the layout. To do that, it uses one of the following algorithms:

- - - -

Normal flow

- -

In the normal flow, boxes are laid out one after the other. In a block formatting context, they are laid out vertically; in an inline formatting context, they are laid out horizontally. The normal flow is triggered when the CSS {{ cssxref("position") }} is set to the value static or relative, and if the CSS {{ cssxref("float") }} is set to the value none.

- -

Example

- -
When in the normal flow, in a block formatting context, boxes are laid vertically one after the other out:
-
-[image]
-
-When in the normal flow, in an inline formatting context, boxes are laid horizontally one after the other out:
-
-[image]
- -

There are two sub-cases of the normal flow: static positioning and relative positioning:

- - - -

Floats

- -

In the float positioning scheme, specific boxes (called floating boxes or simply floats) are positioned at the beginning, or end of the current line. This leads to the property that text (and more generally anything within the normal flow) flows along the edge of the floating boxes, except if told differently by the {{ cssxref("clear") }} CSS property.

- -

The float positioning scheme for a box is selected, by setting the {{ cssxref("float") }} CSS property on that box to a value different than none and {{ cssxref("position") }} to static or relative. If {{ cssxref("float") }} is set to left, the float is positioned at the beginning of the line box. If set to right, the float is positioned at the end of the line box. In either case, the line box is shrunk to fit alongside the float.

- -

[image]

- -

Absolute positioning

- -

In the absolute positioning scheme, boxes are entirely removed from the flow and don't interact with it at all. They are positioned relative to their containing block using the {{ cssxref("top") }}, {{ cssxref("bottom") }}, {{ cssxref("left") }} and {{ cssxref("right") }} CSS properties.

- -

An element is absolutely positioned if the {{ cssxref("position") }} is set to absolute or fixed.

- -

With a fixed positioned element, the containing block is the viewport. The position of the element is absolute within the viewport. Scrolling does not change the position of the element.

- -

Див. також

- - diff --git a/files/uk/web/css/z-index/index.html b/files/uk/web/css/z-index/index.html deleted file mode 100644 index 364b1044a2..0000000000 --- a/files/uk/web/css/z-index/index.html +++ /dev/null @@ -1,134 +0,0 @@ ---- -title: z-index -slug: Web/CSS/z-index -translation_of: Web/CSS/z-index ---- -
{{CSSRef}}
- -

CSS властивість z-index встановлює порядок осі Z спозицйонованого елементу, його нащадків або елементів з властивістю flex. Елементи з більшим z-index перекривають такі, в яких ця величина менша.

- -
{{EmbedInteractiveExample("pages/css/z-index.html")}}
- - - -

В спозицйонованому елементі (такому, в якому властивість position є будь-якою окрім static) властивість z-index вказує:

- -
    -
  1. Рівень накладання елемента в поточному контексті накладання.
  2. -
  3. Чи створює цей елемент локальний контекст накладання.
  4. -
- -

Синтаксис

- -
/* Властивість, зазначена ключовим словом */
-z-index: auto;
-
-/* Цифрові значення <integer> */
-z-index: 0;
-z-index: 3;
-z-index: 289;
-z-index: -1; /* Цифри менше нуля зменьшують приорітет */
-
-/* Глобальні значення */
-z-index: inherit;
-z-index: initial;
-z-index: unset;
-
- -

Властивість z-index вказується або ключовим словом auto або цифрою <integer>.

- -

Вартості

- -
-
auto
-
Контейнер не визначає нового локального контексту накладання. Рівень накладання створеного контейнеру в поточному контексті накладання є такий самий як і батьківський.
-
<integer>
-
{{cssxref("<integer>")}} вказує рівень накладання створеного контейнеру в поточному контексті накладання. Контейнер також створює локальний контекст накладання в якому його рівень накладання дорівнює 0. Це означає що вартість z-index елементів-нащадків не порівнюється з z-index елементів поза цим елементем.
-
- -

Формальний синтаксис

- -
auto | {{cssxref("<integer>")}}
- -

Приклади

- -

HTML

- -
<div class="dashed-box">Коробка з пунктиром
-  <span class="gold-box">Золота коробка</span>
-  <span class="green-box">Зелена коробка</span>
-</div>
-
- -

CSS

- -
.dashed-box {
-  position: relative;
-  z-index: 1;
-  border: dashed;
-  height: 8em;
-  margin-bottom: 1em;
-  margin-top: 2em;
-}
-.gold-box {
-  position: absolute;
-  z-index: 3; /* розташуй .gold-box над .green-box та .dashed-box */
-  background: gold;
-  width: 80%;
-  left: 60px;
-  top: 3em;
-}
-.green-box {
-  position: absolute;
-  z-index: 2; /* розташуй .green-box над .dashed-box */
-  background: lightgreen;
-  width: 20%;
-  left: 65%;
-  top: -25px;
-  height: 7em;
-  opacity: 0.9;
-}
-
- -

Результат

- -

{{ EmbedLiveSample('Examples', '550', '200', '') }}

- -

Специфікації

- - - - - - - - - - - - - - - - - - - - - -
СпецифікаціяСтатусКоментар
{{SpecName('CSS3 Transitions', '#animatable-css', 'поводження анімації z-index')}}{{Spec2('CSS3 Transitions')}}Означає z-index як такий, який можна анімувати.
{{SpecName('CSS2.1', 'visuren.html#z-index', 'z-index')}}{{Spec2('CSS2.1')}}Початкове визначення
- -

{{cssinfo}}

- -

Браузерна сумісність

- - - -

{{Compat("css.properties.z-index")}}

- -

Дивись також

- - -- cgit v1.2.3-54-g00ecf