好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

Div高度百分比_html/css_WEB-ITnose

有时候设置高度百分比,没有效果。

原因是父元素没有设置高度。

父元素可以设置高度为具体的px。或是100%等百分比。

这样子元素再能根据百分比来设置高度。

           html,body {            width:100%;            height:100%;            margin:0px;            padding:0px;        }        .center {            width:80%;            margin:auto;        }        #top {            height:20%;            background-color:yellow;        }        #module {            height:60%;            background-color:gray;        }        #bottom {            height:20%;            background-color:blue;        }          

查看更多关于Div高度百分比_html/css_WEB-ITnose的详细内容...

  阅读:31次