【发布时间】:2011-11-05 11:41:18
【问题描述】:
通过教程http://www.sohtanaka.com/web-design/facebook-style-footer-admin-panel-part-1/ 并尝试制作固定顶部栏(就像 Facebook、twitter、techCrunch 和任何其他流行的网站一样),但该栏在 ZOOM 上失败。
这是我的意思的一个例子——http://rtabl.es/designingforstartups——如果你放大那个链接,你可以看到右边的内容从屏幕上消失了。同样的事情发生在我身上,我不希望内容在缩放时消失..
这是测试代码,按照教程,给容器一个position:fixed,内容有position:relative和float:left——想知道我哪里出错了。
代码——
<html>
<style type="text/css">
#Contianer{
position: fixed;
height: 35px;
width: 100%;
z-index: 9999;
color: white;
background-color: #474747;
}
.x{
float: left;
text-align: center;
position: relative;
line-height: 35px;
border:1px solid white;
}
#a{
width:20%;
text-align: left;
min-width: 100px;
}
#b{
width:20%;
min-width: 100px;
text-align: left;
height: 35px;
display: table-cell;
}
#c{
min-width: 200px;
width:40%;
}
#d,#e{
min-width: 50px;
width:10%;
}
body{
border:0;
margin: 0;
}
</style>
<body>
<div class="Contianer" id="Contianer">
<div id="a" class="x">
foo
</div>
<div id="b" class="x">
bar
</div>
<div id="c" class="x">
tom
</div>
<div id="d" class="x">
jerry
</div>
<div id="e" class="x">
Out
</div>
</div>
</body>
【问题讨论】:
-
尝试将 div 替换为 ul(用于容器)和 li 用于内容,dint 似乎有效。即使在缩放之后,教程中的底部栏也保持正常..
-
不仅缩放,而且缩小浏览器窗口的大小也会隐藏它们。
-
是的,希望能找到解决办法或知道我哪里出错了..
标签: css css-position