【发布时间】:2019-03-25 16:33:12
【问题描述】:
overflow:hidden 属性在 google chrome 中工作,而不是在 firefox 和 microsoft edge 中工作,我正在使用它为侧边栏提供整个页面高度,以便它具有相同的正文高度。
风格:
.sidebar {
position:absolute;
width: 225px;
background-color: #4b4b4b;
margin-bottom: -5000px;
padding-bottom: 5000px;
overflow: hidden;
}
html:
<div class="sidebar">
<div class="nav-item active">
<a class="nav-link border-bottom border-warning {{Request::path()=='home' ? 'selectioné' : ''}}" href="home"><span>Dashboard</span></a>
</div>
<div class="nav-item">
<a class="nav-link border-bottom border-warning {{Request::path()=='register' ? 'selectioné' : ''}}" href="register"><span>Ajout Compte</span></a>
</div>
<div class="nav-item">
<a class="nav-link border-bottom border-warning" href="*******"><span>*******</span></a>
</div>
<div class="nav-item">
<a class="nav-link border-bottom border-warning" href="/telescope" target="_blank"><span>Telescope</span></a>
</div>
<div class="nav-item">
<a class="nav-link border-bottom border-warning" href="tables.html"><span>Tables3</span></a>
</div>
<div class="nav-item">
<a class="nav-link border-bottom border-warning" href="tables.html"><span>Tables4</span></a>
</div>
</div>
正文:
body {
position: relative;
min-height: 100vh;
padding-bottom: 4.5rem;
}
页脚:
footer {
position: absolute;
border-radius: 12px;
right: 0;
bottom: 0;
width: calc(100% - 225px);
height: 80px;
background-color: #e2e2e2;
text-align: center;
padding-top: 28px;
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
}
主要:
.main {
width: 100%;
padding-left: 225px;
padding-top: 11px;
padding-bottom: 30px;
}
我怎样才能使它在所有浏览器中都能正常工作?
【问题讨论】:
-
你也可以分享HTML吗?谢谢
标签: css firefox overflow sidebar