元素屬性改變的漸變動(dòng)畫效果
* {
-webkit-transition: all .2s ease;
transition: all .2s ease;
-ms-transition: all .2s ease;
}
vertical-align屬性針對(duì)inline(block)元素設(shè)置瞒斩,相對(duì)的偏移是根據(jù)line-height屬性而來的,而不是height
//html
<div id="demo">
<span>line</span>
</div>
//css
div#demo {
width: 100px;
height: 100px;
background-color: aqua;
}
div#demo span {
display: inline-block;
height: 80px;
line-height: 40px;
background-color: red;
vertical-align: middle;
}
![效果圖](http://static.zybuluo.com/melunar/99kccac4huhmp7a9ityhtc5l/image_1b8b3tmrn1hts150913pv1rub1u8fp.png)
效果圖