Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Властивості Flex-Елементів | Флексбокс
Основи CSS
course content

Зміст курсу

Основи CSS

Основи CSS

2. CSS для Тексту
3. Бокс Модель та Відстань між Елементами
4. Флексбокс
5. Декоративні Ефекти

book
Властивості Flex-Елементів

flex-basis

Властивість flex-basis визначає початковий розмір flex-елемента до того, як буде розподілено решту простору. Вона визначає ідеальний розмір flex-елемента, який може бути скоригований залежно від доступного простору та інших властивостей flex-контейнера.

css

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

flex-basis

The flex-basis property defines the initial size of a flex item before any remaining space is distributed. It specifies the ideal size of a flex item, which may be adjusted depending on the available space and other properties of the flex container.

css

You can define the size using pixels, percentages, or ems to specify the ideal size or set it to auto, which allows the browser to determine the size based on the item's content.

html

index.html

css

index.css

copy

flex-grow

The flex-grow property determines the ability of a flex item to grow in relation to other items within a flex container when there is surplus space available.

The flex-grow property accepts a unitless value that signifies the relative size of the flex item compared to other items. To illustrate, if one item has a flex-grow value of 2, and another has a value of 1, the first item will grow twice as much as the second item when there is surplus space in the flex container.

html

index.html

css

index.css

copy

order

The order property is used to define the display order of flex items within their container. By default, flex items are displayed in the order they appear in the HTML document. However, we can modify this order using the order property.

The order value can be any number. Even if we have only 3 elements, assigning order: 1000; to the second element doesn't mean we will have 1000 elements. It simply means that the second element will be placed in the last position. Additionally, if some elements share the same order value, the browser will position them in the order they appear in the HTML document. Let's rearrange the order of items in the following list. The task is to place the third item in the first position.

html

index.html

css

index.css

copy

1. Що робить властивість flex-grow?

2. Що робить властивість flex-basis?

question mark

Що робить властивість flex-grow?

Select the correct answer

question mark

Що робить властивість flex-basis?

Select the correct answer

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 4. Розділ 5
Ми дуже хвилюємося, що щось пішло не так. Що трапилося?
some-alt