【发布时间】:2012-12-14 07:16:54
【问题描述】:
我正在尝试将高度设置为相对于屏幕大小(高度 = 12%),但我不希望它超过某个像素高度(即最大高度:150 像素)。什么是合适的CSS。我试过了:
.titleBar {
position: relative;
background-color: #5C755E;
padding: 1%;
height: 12%;
max-height: 100px;
border-bottom: .45em solid #DEB887;
top:0;
left:0;
width: 100%;
}
但这忽略了 max-height 属性。在我的大桌面屏幕上,标题栏变成 200 像素(太大了)。
【问题讨论】:
-
又一个路过的投票,没有解释。我希望堆栈溢出能够在不解释原因的情况下解决这个投票不足的问题。
标签: height fluid-layout css