我遇到了一个 CSS 问题,需要一些建议。我有一个包含固定宽度的 100% div。在 27"上,一切看起来都很好 - 黄色 div 完美居中。
当我调整窗口大小时,黄色的固定栏仍然可见,但只要您向右滚动,100% 的 div 就不会调整为当前宽度。
<html>
<head>
<title></title>
</head>
<body>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" />
<style type="text/css">
#footer {
background-color: #333333;
color: #ffffff;
margin-top: 35px;
padding-bottom: 30px;
padding-top: 15px;
position: relative;
bottom: 0px;
font-size: 90%;
}
#inner {
background-color: #feb400;
width: 960px;
margin-left: auto;
margin-right: auto;
}
</style>
<body>
<footer id="footer">
<div id="inner">lorem ipsum div.</div>
</footer>
</body>
</html>
我希望始终调整黑色 100%-div 的大小。我怎样才能做到这一点?
谢谢。
最佳答案
关于jquery - 100% Div 居中,固定宽度的内部 Div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27058903/