gpt4 book ai didi

css - 垂直对齐div内的div?

转载 作者:行者123 更新时间:2023-11-28 12:33:44 25 4
gpt4 key购买 nike

当内部 div 具有静态高度时,在另一个 div 中垂直对齐一个 div 的好方法是什么?至于高度,有时会有所不同。 http://jsfiddle.net/daCt3/

HTML:

<div id="footer">
<div id="footerLeft">
<div id="copyright">
<!-- <copy> -->Copyright MyCorp &copy; 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;
}

最佳答案

用于粘性行为的 float 框,用于列 View 的边距百分比单位是大多数人在其网站中使用的内容。检查google.org举个例子。

关于css - 垂直对齐div内的div?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18092406/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com