当前位置:网站首页>Margin left: -100% understanding in the Grail layout
Margin left: -100% understanding in the Grail layout
2022-07-03 07:17:00 【darabiuz】
If not set margin-left:100% Words , that left and right Elements will be squeezed into the second line because of insufficient space 
1. Yes margin Interpretation of values :
① Father son relationship :margin-left It refers to the left boundary between the child and the father ( If father has left padding value , It refers to this padding Line ) Distance of .margin-right It refers to the right boundary between the child and the father ( If father has right padding value , It refers to this padding Line ) Distance of .
② Brotherhood :margin-left It refers to my left boundary and my left brother's right boundary ( If brothers have right padding value , It refers to this padding Line ) Distance between .margin-right It refers to the distance between my right boundary and my right brother's left boundary ( If brothers have left padding value , It refers to this padding Line ).
The illustration :
2. about margin Understanding of taking negative values :
margin Negative values change the space occupied by elements . If you don't give him negative value , It must show on the second line , Because he occupies space .
This example ,left The width is 200px, When I set left Of margin-left by 200px, When it is the same width as him : That's what happens :
Obviously, we need to move more to the left , What is the distance of movement ?
center Width - left Width , That is, the distance marked in red in the figure below
We can conclude that : Just set up margin-left The negative value of is center The width of ( Initially moved 200px+ Distance to be moved ==center Width )
The second most intuitive understanding :
left The distance from the left of to the right of the parent element is equal to 200px
3. margin-left The meaning when the value of the attribute is a percentage :
When margin-left Percentage of value , Is the percentage relative to the width of the parent element
In the Grail layout, we set center The width is 100%, So the width of the parent element 100% Exactly equal to center Width , That's what we want 
边栏推荐
- SecureCRT password to cancel session recording
- Use the jvisualvm tool ----- tocmat to start JMX monitoring
- 10 000 volumes - Guide de l'investisseur en valeur [l'éducation d'un investisseur en valeur]
- SecureCRT取消Session记录的密码
- 树莓派更新工具链
- 《指環王:力量之戒》新劇照 力量之戒鑄造者亮相
- II. D3.js draw a simple figure -- circle
- 2021 year end summary
- Hash table, generic
- 【CMake】CMake链接SQLite库
猜你喜欢

《指环王:力量之戒》新剧照 力量之戒铸造者亮相
![[solved] sqlexception: invalid value for getint() - 'Tian Peng‘](/img/bf/f6310304d58d964b3d09a9d011ddb5.png)
[solved] sqlexception: invalid value for getint() - 'Tian Peng‘
![[Fiddler problem] solve the problem about Fiddler's packet capturing. After the mobile network is configured with an agent, it cannot access the Internet](/img/9d/42dfef67246740f0dba0c6d8f1b625.jpg)
[Fiddler problem] solve the problem about Fiddler's packet capturing. After the mobile network is configured with an agent, it cannot access the Internet

多个全局异常处理类,怎么规定执行顺序

Docker builds MySQL: the specified path of version 5.7 cannot be mounted.

4279. Cartesian tree

Notes on the core knowledge of Domain Driven Design DDD

docker建立mysql:5.7版本指定路径挂载不上。

IP home online query platform

Sorting out the core ideas of the pyramid principle
随机推荐
Advanced API (use of file class)
Distributed transactions
mysql误删root账户导致无法登录
Pits encountered in the use of El checkbox group
691. Cube IV
php安装composer
4279. 笛卡尔树
centos php7.2.24升级到php7.3
php安装swoole扩展
PHP install the spool extension
RestHighLevelClient获取某个索引的mapping
Recursion, Fibonacci sequence
Unit test notes
sharepoint 2007 versions
JMeter test result output
7.2 brush two questions
Dora (discover offer request recognition) process of obtaining IP address
Setting up the development environment of dataworks custom function
TypeScript let与var的区别
dataworks自定义函数开发环境搭建
