Using flex layout, if it is a nine-square grid, it can be divided equally, as shown in the figure If we only need eight pieces, as shown in the figure But if we want the last block to be left-aligned and arranged in sequence, we need to add a pseudo-element after to the parent of the element, as shown in the figure <div class="box"> <ul> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> </ul> </div> ul{ display: flex; flex-wrap: wrap; justify-content: space-between; } ul:after{ content: ""; width: 32%; } ul li{ width: 32%; height: 10vh; margin-bottom: 1vh; background: #2fbaff; } This concludes this article about how to implement left-alignment of the last line in flex box layout. For more flex layout content, please search previous articles on 123WORDPRESS.COM or continue browsing the following related articles. I hope you will support 123WORDPRESS.COM in the future! |
<<: SQL implementation LeetCode (176. Second highest salary)
>>: Vue implements simple calculator function
Install grafana. The official website provides an...
In today's development environment, fast is b...
MySQL 8 official version 8.0.11 has been released...
<br />Original source: http://www.a-xuan.cn/...
The project was tested these days, and the tester...
Table of contents 1. Introduction to NFS 2. NFS C...
Table of contents 【Common commands】 [Summary of c...
This article shares the specific code of React to...
1. Use of CSS scope (style division) In Vue, make...
There was a shaking barrage on TikTok a while ago...
There are many articles about MySQL installation ...
PS: I use PHPStudy2016 here 1. Stop MySQL during ...
Detailed tutorial on downloading and installing M...
Rendering Example Code Today we are going to use ...
1. Traditional binlog master-slave replication, s...