Home >Web Front-end >HTML Tutorial >css positioning_html/css_WEB-ITnose
Hello everyone
The following html code:
6c04bd5ca3fcae76e30b72ad730ca86d
845bc0347d2f48a149098cc22d7a5f95
16b28748ea4df4d9c2150843fecfba68
b9bd0306a961370f0e27d0a471e1049716b28748ea4df4d9c2150843fecfba68
36cc49f0c466276486e50c850b7e4956
I want to realize that mainTool is always at the bottom, and the height of content is other than mainTool. So my css is written like this:
*{margin:0;padding:0;}html,body{ height: 100%;}body{ background: black;}#content { height:100%; border-bottom: 50px; }#mainTool { position:absolute; //这里设置绝对定位,当有这一句时,整个mainTool都消失不见了。去掉的话就可以见到。 bottom: 0px; //使它一直在底部 background-color: yellow ; height: 50px; //高度为固定的50px;}
#mainTool { position:absolute; bottom: 0px; background-color: yellow ; height: 50px; width:100%; /*增加这一条样式*/}
That’s it. Thanks. That's it.
CSS code
#mainTool {
position:absolute;
bottom: 0px;
background-color: yellow;
height: 50px;
width:100%; / *Add this style*/
}