Detailed explanation of the new CSS display:box property

Detailed explanation of the new CSS display:box property

1. display:box;

Setting this property on an element will cause its children to be arranged on the same level, similar to display:inline-block;.

2. The following properties can be set in its children

Prerequisite: To use the following properties, you must set display:box in the parent;

1.box-flex:number;

1) Number of parent element widths

2) If a child element is set with a fixed width, the child element will use the fixed width, and other child elements that are not set with a fixed width will use the remaining parent width (parent - total width of child elements with fixed widths in number).

3) If the child element has a margin value, the remaining width (parent width - child fixed total width - total margin value) is number parts

2.box-orient:horizontal/vertical

Setting this property on the parent will cause the children to be arranged horizontally or vertically.

Note: All major browsers do not support this property and a prefix must be added.

1) horizontal arrangement, the total width of the children = the width of the parent. If the parent has a fixed width, the width set for the child will be invalid, and the child will fill the parent's width.

2) vertical arrangement, the total height of the children = the height of the parent. If the parent has a fixed height, the height set for the child will be invalid, and the child will fill the parent's height.

3.box-direction:normal/reverse

Set this property on the parent to determine the order in which the children are sorted.

1) normal default value, children are arranged in HTML order

2) reverse

4.box-align:start/end/center/stretch

Sets the vertical alignment of the child at the parent level.

1) Start vertical top alignment

2) end vertical bottom alignment

3) center vertical alignment

4) stretch stretches the height of the child to match the height set by the parent. The child height is invalid.

5.box-pack:start/end/center

Sets the horizontal alignment of the child at the parent level.

1) Start horizontal left alignment

2) end horizontal right alignment

3) Center horizontal alignment

Summarize

The above is the new CSS display:box attribute that I introduced to you. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

<<:  Practical tutorial on modifying MySQL character set

>>:  HTML form tag tutorial (2):

Recommend

Create a code example of zabbix monitoring system based on Dockerfile

Use the for loop to import the zabbix image into ...

Common array operations in JavaScript

Table of contents 1. concat() 2. join() 3. push()...

When modifying a record in MySQL, the update operation field = field + string

In some scenarios, we need to modify our varchar ...

Detailed steps to install mysql in Win

This article shares the detailed steps of install...

Summary of the pitfalls of using primary keys and rowids in MySQL

Preface We may have heard of the concept of rowid...

Vue 2.0 Basics in Detail

Table of contents 1. Features 2. Examples 3. Opti...

Summary of events that browsers can register

Html event list General Events: onClick HTML: Mous...

I have sorted out some domestic design websites that I think are good.

<br />I have compiled some domestic design w...

Detailed process of installing and deploying onlyoffice in docker

0. System requirements CPU I5-10400F or above Mem...

How to convert a string into a number in JavaScript

Table of contents 1.parseInt(string, radix) 2. Nu...

Detailed explanation of MySQL database transaction isolation levels

Database transaction isolation level There are 4 ...

Solve the problem of OpenLayers 3 loading vector map source

1. Vector Map Vector graphics use straight lines ...

The three new indexes added in MySQL 8 are hidden, descending, and functions

Table of contents Hidden, descending, and functio...

How to deploy kafka in docker

Table of contents 1. Build Docker 2. Enter the co...