This article introduces the flex layout to achieve a fixed number of rows per line + adaptive layout, and shares it with you. The details are as follows: Effect display Analysis <div class="template" v-for="(item,templateIndex) in 7"> <div @click="useTemplate()" v-touch:long="(e)=>touchin(groupIndex,templateIndex)"> <img class="icon" src="../../../assets/home-page/templateIcon.png" alt /> <div class="templateName">Template name</div> </div> </div> // Parent box, set to: .templateItem { width: 100%; text-align: center; display: flex; align-content: flex-start; flex-flow: row wrap; } //Subbox, set to: .template { flex: 0 0 25%; margin-bottom: 20px; } Parent box settings: The sub-box arrangement method is flex-start. The sub-boxes are placed from the starting point, and line breaks are set by flex-flow. If line breaks are not set, the sub-elements will shrink in size to achieve the effect of being placed in one line. Subbox settings: Use flex:0 0 25% to set the placement of the child box. The flex property is an abbreviation of flex-grow, flex-shrink, and flex-basis. The default values are 0, 1, and auto. Specify the number of shares of the sub-item Disassembly explanation: flex:0 0 25% is equal to flex-grow=0 (no enlargement by default) + flex-shrink=0 (no shrinkage) + flex-basis=25% (the project occupies the main axis space) For an initial understanding of flex layout, you can read our blog: Initial understanding of flex layout This is the end of this article about how to use flex layout to achieve a fixed number of rows + adaptive layout. For more information about how to use flex layout to achieve a fixed number of rows + adaptive layout, please search previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future! |
<<: Detailed graphic explanation of sqlmap injection
>>: HTML meta viewport attribute description
1. How to construct? Let's review the common ...
When using Navicat to connect to a remote Linux M...
This article mainly introduces the sample code of...
MySQL transaction support is not bound to the MyS...
Project Scenario Add a custom watermark to the en...
Table of contents origin status quo Cancel reques...
1. Preparation After installing the Linux operati...
1. Apache 2.4.41 installation and configuration T...
Table of contents topic analyze Objects of use So...
Start the mysql container in docekr Use command: ...
I won’t talk about the use of SSL certificates. F...
Install mysql5.7.18 on CentOS6.7 1. Unzip to the ...
Prerequisites for installing MySQL: Install CentO...
Preface To put it simply, tcpdump is a packet ana...
1. Optimize Nginx concurrency [root@proxy ~]# ab ...