The HTML structure is as follows: The CCS structure is as follows: The page effect diagram is as follows: Now we can see that 50px to the right and 50px to the bottom are clearly set in the child element, but the effect displayed on the page is only moving to the right but not downward. Generally speaking, Margin-top: 50px, but the page has no effect, which means that the margin has collapsed. So what is margin collapse? When setting When we adjust margin-top: 50px to a height greater than the parent element, the child element will no longer be positioned relative to the parent element but will move 150px downwards with the parent element relative to the browser. To solve the margin collapse problem, we need to use the concept of bfc: BFC stands for The elements that trigger bfc are:
The CSS structure is as follows: The page effect is as follows: Any of the above lines can make up for the problem of margin collapse~ Summarize This is the end of this article about margin: top collapse in CCS. For more relevant CCS margin: top collapse content, 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! |
<<: Unicode signature BOM detailed description
>>: The difference between Vue interpolation expression and v-text directive
This article example shares the specific code of ...
Frequently asked questions When you are new to ea...
Use JOIN instead of sub-queries MySQL supports SQ...
This article records the installation and configu...
Contents of this article: Page hollow mask layer,...
MySQL partitioning is helpful for managing very l...
When the height attribute of Text is defined, the ...
Introduction to structure and performance HTML st...
Table of contents Base Return Type String and Boo...
mysqladmin is an official mysql client program th...
Table of contents 1. Generate AST abstract syntax...
This article explains how to install MySQL from a...
When playing music, the lyrics will gradually fil...
This article is original by 123WORDPRESS.COM Ligh...
To export MySQL query results to csv , you usuall...