我的网站有一个页脚内容, 但如果你在更大的屏幕上看,或者缩小, 它会流出 div。
LIVE DEMO
代码
#yht { //Footer container
width: 100%;
min-height: 20px;
max-height: 30px;
vertical-align: middle;
background: black;
text-align:center;
opacity: 0.7;
max-height: auto;
height: auto;
overflow: hidden;
}
#main:hover #yht span {
opacity: 1;
}
#yht span {
text-align:center;
position: relative;
display: block;
margin-top: auto;
margin-bottom: auto;
padding: 5px;
}
#yht2 { //Text ul
display: block;
height: auto;
max-height: auto;
margin-top: auto;
margin-bottom: auto;
}
#yht2 ul li {
font-size: 50px;
color: magenta;
overflow: hidden;
display: block;
margin-top: auto;
margin-bottom: auto;
}
最佳答案
移除 ID #yht
上的 max-height: 30px;
。
关于HTML - 防止溢出?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21283962/