Зміст курсу
Introduction to CSS Part I
Introduction to CSS Part I
Box Model Properties
The box model in CSS specifies the layout and design of elements on a webpage. It is based on the concept of a box surrounding each element, which consists of the following properties:
- Width and height. These properties specify the element's dimensions. They can be set using absolute units (such as pixels) or relative units (such as percentages or ems);
- Margin: The margin is the space outside the element's border. It can add space around the element and separate it from other elements on the page. Margins can be set using any of the units mentioned above;
- Border. The border is a line that surrounds the element and separates it from the margin. It can have a specific width, style (such as solid, dotted, or dashed), and color.
- Padding. The padding is the space inside the element's border. It can add space around the element's content, such as text or images. Padding can be set using any of the units mentioned above.
A very simplistic representation is given below, which shows how the block-level elements behave when box-model properties are applied to them and how their size gets influenced by these.
Дякуємо за ваш відгук!