Non-orthogonal margins When margin is used, it will cause merging The following properties will prevent margin merging: border display: table display: flex The above content is the result of the detailed explanation below Blocking merger [Detailed explanation] /* CSS */ .box{ border:1px solid red; height: 100px; margin: 10px; /* Note: this is 10 pixels! */ } <!-- HTML --> <div class="box"></div> <div class="box"></div> <div class="box"></div> This is what it looks like in the browser: According to the rational number margin, the spacing between the top and bottom of the div should be 20px Solution 1: <!-- HTML --> <!-- css unchanged --> <div class="box"></div> <div style="border: 1px solid blue"></div> <!-- Newly added --> <div class="box"></div> <div style="border: 0.1px solid blue"></div> <!-- Newly added --> <div class="box"></div> <div class="box"></div> This is what it looks like in the browser: <!-- HTML --> <!-- css unchanged --> <!-- HTML --> <div class="box"></div> <div style="display: table"></div> <div class="box"></div> <div style="display: flex"></div> <div class="box"></div> <div class="box"></div> <!-- display:block / inline will not block merging, only table flex can --> This is what it looks like in the browser: Other Impacts display will affect the small dots of ul li position: absolute will affect display: inline position: fixed will affect transform float affects inline The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. |
<<: Detailed explanation of creating, calling and managing MySQL stored procedures
>>: Usage of the target attribute of the html tag a
Table of contents 1. Problems encountered 2. Anal...
Detailed example of getting the maximum value of ...
Table of contents 1. Introduction to NFS 2. NFS C...
Table of contents Preface Motivation for Fragment...
Brief review: Browser compatibility issues are of...
Nginx's shared memory is one of the main reas...
Table of contents cause reason Introduction to NP...
Environmental Description: There is a running MyS...
Preface This article analyzes the process of shut...
1. Overview This article systematically explains ...
Background of the problem The server monitoring s...
This article summarizes the implementation method...
Limit input box to only pure numbers 1、onkeyup = ...
1. Create the tomcat installation path mkdir /usr...
RPM package management A packaging and installati...