【发布时间】:2014-07-15 15:16:08
【问题描述】:
当缩小浏览器窗口镶边时,.sidebar(在某些阶段)将不会显示。 在 Firefox 中,一切正常(侧边栏不会消失)并且会出现递减的水平滚动窗口。 chrome如何实现同样的效果?
.container 应该是有弹性的。当 .container 时,应该会出现 gorizonalny 滚动
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
html, body {
margin: 0;
color: #000;
background: #CCC;
}
.container {
float: left;
max-width: 750px;
min-width: 550px;
margin-right: 250px;
background: #FFF;
}
.sidebar {
float:left;
margin-left: -250px;
width: 250px;
background-color: #444;
color: #FFF;
}
</style>
</head>
<body>
<div class="container">In that case, Semak would be confronted with two of Zenit’s most difficult matches of the season. On Saturday, Zenit has a league class away to reigning Russian champions CSKA Moscow, before attempting to keep their European hopes alive away to Dortmund</div>
<div class="sidebar">In the meantime, the source said the team would be managed by reserves coach Sergei Semak</div>
</body>
</html>
【问题讨论】:
-
由于 sidebar 类中的负边距,请尝试在 .sidebar 和 .container 中都没有边距,并且当窗口中的宽度小于 clases 中定义的宽度时,最后一个元素将折叠。跨度>
-
WTF 是 "gorizonalny 滚动"?
-
@j08691 - 你从来没有在你的第一根手指在错误的字母上输入过一个单词吗?它搞砸了整个词:D 我假设他的意思是“水平”
标签: html css google-chrome margin