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
Abstract: Whether at work or in an interview, opt...
Table of contents 01 Introduction to InnoDB Repli...
Contents of this article: Page hollow mask layer,...
I used the dialog in closure and drew a dialog wit...
This article example shares the specific code of ...
1 Create a user and specify the user's root p...
This article shares the specific code of jQuery t...
Use MySQL proxies_priv (simulated role) to implem...
Written in front I have been writing a special to...
【1】Know the width and height of the centered elem...
Server: Ubuntu Server 16.04 LSS Client: Ubuntu 16...
vue+element UI encapsulates a public function to ...
Table of contents Review of Vue2 responsive princ...
1. Uninstall the JDK that comes with centeros fir...
I made a Dockerfile for openresty on centos7 and ...