2016-09-20 77 views
-1

Image of Issues不能设置底部股利仅低于相邻的顶部股利

h1,h2,h3,h4,h5,h6 { 
 
    font-size: 100%; 
 
}
<!--top Div--> 
 
<div style="width: 100%; height:100%;background-color: orange"> 
 
    <div style="width: 80%; height:20%;color: navy; background-color: yellow; solid blue;text-align:right;align:center;margin: 0 auto;"> 
 
    <div style="width: 20%; height:80%;color: navy; background-color: pink; border: 1px black; padding: 5px;float:right"> 
 
     <h2> <p style="text-align:right;">Enter Site Title</p> </h2> 
 
     <h1> <p style="text-align:right;">Enter Site Slogen</p> </h1> 
 
    </div> 
 
    </div> 
 
    <!-- top Div Close --> 
 

 
    <div style="width: 80%; height:80%;color: navy; background-color: pink; solid blue;text-align:right;align:center;margin: 0 auto"> 
 
    <div style="width: 100%; height:85%;background-color: green;position: relative;"> 
 
     <div style="width: 30%; height:100%;color: navy; background-color: blue; solid blue;text-align:right;align:left;float: left"> 
 
     <h1 style="text-align:right;" style="margin-right: 20px">Enter Site Title</h1> 
 
     <h2 style="text-align:right">Enter Site Slogen</h2> 
 
     </div> 
 
     <div style="width: 65%; height:100%;color: navy; background-color: cyan; solid blue;text-align:right;align:left;float: right;"> 
 
     <h1 style="text-align:right;margin-right: 20px;">Enter Site Title</h1> 
 
     <h2 style="text-align:right">Enter Site Slogen</h2> 
 
     </div> 
 
    </div> 
 
    <div style="width:100%;height:15%;background-color: red;position: top;clear: both"> 
 
     <p style="text-align:right;font-size:15px;">Enter Site Title</p> 
 
    </div> 
 
    </div> 
 
</div>

你可以看到红色的股利很少得到了家长的div和蓝色的div和红色事业部之间还小的空间。

回答

1

您正在尝试制作页脚。
使页脚抓到底部。
代替打字内嵌CSS的,做一个CSS文件,并通过书面形式把它的HTML页面:

<head> 
    <link rel="stylesheet" href="styles.css"> 
</head> 

<head>部分。

在HTML DIV,写:

​​

在CSS文件,写入:

#footer { 
    clear: both; 
    position: relative; 
    z-index: 10; 
    height: 3em; 
    margin-top: -3em; 
} 

应该留在底部。 :)

+0

感谢您的编辑,我没有注意到我犯的错误。 :) –