Home >Web Front-end >HTML Tutorial >css positioning_html/css_WEB-ITnose

css positioning_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:12:351332browse

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;}


I don’t know where the css problem is, please help


Reply to the discussion (Solution)

#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*/
}

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn