我想讓我的桌子佔用屏幕的80%,但現在它只是表格中內容的大小。css高度80%不工作
#ecom-mainarea .center
{
margin-left: 10%;
position: relative;
width: 80%;
height: 80%; /* when this is 500px it works fine, but % doesn't work */
border: 1px solid;
border-bottom-color: teal;
border-top-color: gray;
border-left-color: gray;
border-right-color: teal;
background-color: white;
voice-family: "\"}\"";
voice-family: inherit;
vertical-align: text-top;
}
奇怪。寬度似乎正在工作。任何其他方法的建議? – 0x4f3759df
支持。 http://www.w3.org/TR/CSS21/visudet.html#the-height-property –
我應該澄清 - 我不認爲它適用於瀏覽器高度,但它應該相對於其容器工作。 –