We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Date:2015-05-13 Title: Css 知识碎片 Tags: Css, Snippets Category:IT
a span之类默认都是inline .width属性对他们无效
a
span
inline
width
有时候需要对他们指定width,将他们display=inline-block即可
display=inline-block
.clearfix:after {content:"\200B"; display:block; height:0; clear:both; } .clearfix { *zoom:1; }
如,实现son在father的正中间(垂直方向上)
.html
<div class="father"> <div class="son"></div> </div>
.css
.father { position: relative; height: 40px; } .son { position: absolute; height: 24px; top: 50%; margin-top: -12px; }