当内部div具有静态高度时,什么是垂直对齐另一个div内的div的好方法?至于身高有时会有所不同。 http://jsfiddle.net/daCt3/垂直对齐div中的div?
HTML:
<div id="footer">
<div id="footerLeft">
<div id="copyright">
<!-- <copy> -->Copyright MyCorp © 2013<!-- </copy> -->
<br>Some more random stuff
</div>
</div>
<div id="footer-right">
</div>
</div>
CSS:对于粘性行为
/*-- FOOTER --*/
#footer {
bottom:0px;
width:100%;
padding-bottom:20px;
padding-top:0px;
background-color:#2C2E31;
border-top:#242426 solid 2px;
position:fixed;
height:100px;
}
#footerLeft {
margin-top:50px;
float:left;
width:300px;
background-color:red;
}
你看了其他答案?像这样:http://stackoverflow.com/questions/14879849/vertical-aligned-div?rq=1 – Whistletoe