inline-flex is the same as inline-block. It is a display:flex container for internal elements and an inline block for external elements. Description of the difference between the two:
In one sentence, when the Flex Box container does not set a width size limit, when display is specified as flex, the width of the FlexBox will fill the parent container, and when display is specified as inline-flex, the width of the FlexBox will wrap the child Item, as shown in the following figure: The corresponding code is as follows: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <style> /*Flex container*/ .flex__container { display: inline-flex; background-color: gray; } /*Flex sub-item */ .flex__item { width: 50px; height: 50px; background-color: aqua; border: 1px solid black; } </style> </head> <body> <!--Flex container--> <div class="flex__container"> <!--Sub-Item in Flex container--> <div class="flex__item"></div> <div class="flex__item"></div> <div class="flex__item"></div> <div class="flex__item"></div> </div> </body> </html> This concludes this article on the differences between flex and inline-flex in CSS. For more information about CSS flex and inline-flex, please search previous articles on 123WORDPRESS.COM or continue browsing the related articles below. I hope you will support 123WORDPRESS.COM in the future! |
>>: An article teaches you how to use Vue's watch listener
This article briefly introduces how to install My...
Data Sharing What kind of data needs to be writte...
In our life, work and study, social networks have ...
Preface In JavaScript, you need to use document.q...
Method 1: Adding values Let's go to MDN to se...
1. Introduction The telnet command is used to log...
Main library execution CREATE DATABASE test CHARA...
In MySQL, you may encounter the problem of case s...
This article example shares the specific code of ...
Three tables are connected. Field a of table A co...
The HTML code for intercepting text beyond multipl...
The test is passed in the nodejs environment. The...
Table of contents 1. Create a socket 2. Bind sock...
Table of contents 1. What is two-way data binding...
When we make a web page, sometimes we want to hav...