We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
结论: 当margin值为负的时候,top\left使自身元素移动,bottom\right使其下\右的元素移动, 看一个例子吧:
<div class="wrap"> <div class="num1">我的right有-10px</div> <div class="num2">我的bottom有-10px</div> <div class="num3">我的top有-10px</div> <div class="num4">我的left有-10px</div> </div>
*{ margin:0; padding:0; } .wrap{ width:440px; border:10px solid #000; display: flex; flex-wrap: wrap; } .wrap > div { box-sizing: border-box; width: 200px; height: 100px; line-height: 90px; text-align: center; } .num1{ border: 5px solid red; margin-right: -10px; } .num2 { border: 5px solid green; margin-bottom: -10px; } .num3{ border: 5px solid blue; margin-top: -10px; } .num4{ border: 5px solid yellow; margin-left: -10px; }
结果:
num2的负值margin-bottom为什么不起作用呢,这是一个需要注意的问题。 参考文章:我知道你不知道的负Margin
The text was updated successfully, but these errors were encountered:
组件化:模板+数据结构
Sorry, something went wrong.
No branches or pull requests
结论: 当margin值为负的时候,top\left使自身元素移动,bottom\right使其下\右的元素移动,
看一个例子吧:
结果:
num2的负值margin-bottom为什么不起作用呢,这是一个需要注意的问题。
参考文章:我知道你不知道的负Margin
The text was updated successfully, but these errors were encountered: