我为网站构建了HTML/CSS页脚。但是,当我调整屏幕大小时,页脚不会调整大小,我只能看到剪切页脚。我希望页脚div能够调整大小,以便随时查看所有文字。任何帮助,将不胜感激。调整调整窗口大小div
/* Footer Style */
#footer-background {
\t position: fixed;
\t height: 30px;
\t left: 0%;
\t bottom: 0%;
\t z-index: 50;
\t width: 100%;
\t background: #000000;
\t opacity: 0.80;
}
#footer-box{
\t width: 95%;
\t margin: auto;
\t padding: 0 10px;
}
#footer-box h2{
\t margin-top: 0;
\t font-size: 20px;
\t text-align: center;
\t line-height: 30px;
\t font-weight: normal;
\t font-family: Arial, sans-serif;
\t color: #A9A9A9;
}
#footer-box a{
\t text-decoration: none;
\t outline: none;
\t color: #A9A9A9;
}
#footer-box a:hover{
\t text-decoration: underline;
}
<!-- Footer bar -->
<div id="footer-background">
\t <div id="footer-box">
\t \t <h2>
\t \t <a href="/abc/">Title 1</a> |
\t \t <a href="/abc/">Title 2</a> |
\t \t <a href="/abc/">Title 3</a> |
\t \t <a href="/abc/">Title 4</a> |
\t \t <a href="/abc/">Title 5</a> |
\t \t <a href="/abc/">Title 6</a> |
\t \t <a href="/abc/">Title 7</a> |
\t \t <a href="/abc/">Title 8</a>
\t \t </h2> \t \t \t
\t </div>
</div>
<!--/ Footer bar -->
您需要删除的固定高度('高度:30PX;')。这个值不会在文本换行时神奇地调整它自己。 – Turnip
这似乎是调整最新的chrome浏览器。这是一个浏览器特定的问题? – jfeferman
@turnip - 我将高度从30px修改为10%,它可以工作。但是页脚的高度对我来说太高了 - 在底部留下了很多空白。然后我将其设置为5%,但这不适用于调整大小。我希望高度与文字高度一样多,并且可以调整大小。有什么建议么? –