我碰到一个CSS问题,我需要一些建议。我有一个包含固定宽度的100%div。在27“时,一切看起来都很好 - 黄色div完全居中。100%Div与居中,固定宽度的内部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总是beeing调整。我怎样才能做到这一点?
感谢。
如果你想在外层div留100%,那么你应该使用'MAX-width'为你内心的div - HTTP:// jsfiddle.net/nghg4zd5/1/ – Pete 2014-11-21 10:19:46
我不明白你的问题。请解释一下你需要什么 – 2014-11-21 10:20:08