【发布时间】:2014-01-30 14:57:02
【问题描述】:
为什么我的 div 仅根据其内容着色?这是下面代码中按钮的高度。div 仅包装其内容。
我的 div 元素是
<div id="test">
<button>testing</button?
</div>
在css中
#test{
background-color:#666;
width:100%;
height:100%;
}
我将高度设置为 100%,但它只为按钮元素的高度着色。如何为网站的整个高度着色?最好的方法是什么?
【问题讨论】: