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

css positioning_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:12:35
Original
1335 people have browsed it

Hello everyone
The following html code:







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;}
Copy after login


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%; /*增加这一条样式*/}
Copy after login

That’s it. Thanks. That's it.
CSS code
#mainTool {
position:absolute;
bottom: 0px;
background-color: yellow;
height: 50px;
width:100%; / *Add this style*/
}

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template