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

Зміст курсу

Основи CSS

Основи CSS

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

book
Бокс Модель

HTML elements are rendered as rectangular boxes on a web page. Each element has its content area, padding, border, and margin.

  • The content area is the space where the actual content of the element resides. Its width depends on the element type (block-level or inline - we will consider the difference between them and their specificity to work with further in the course). Its height depends on the content itself;
  • The padding is the area between the content and the border, which can be used to add space between the content and the border;
  • The border surrounds the element. By default, the border width is 0. Also, if we do not specify the border color, the border takes the color of the content;
  • The margin is the space between the border and other elements on the page.
html

index.html

css

index.css

copy

Властивості width та height

Властивості width і height використовуються для визначення розміру елемента. Ширина і висота елемента можуть змінюватися залежно від типу бокс моделі.

width and height properties

width and height properties are used to define the size of an element. The width and height of an element can vary depending on the type of box model.

html

index.html

css

index.css

copy

It is also important to mention that for most elements, having only the width property is often sufficient, as the height will be determined automatically. This helps avoid overflow problems when the content's width or height is less than the content inside.

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

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

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

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