我的页面上有三列,左、中和右。左边和中间的在浏览器中定位很好。但是最右边的位置不正确,如果我给它相同的 margin-top:30px (就像其他 div 一样)它会沿着屏幕向下移动吗?
感谢您的任何建议
CSS:
#firstColumn
{
position:relative;
margin-left:20px;
width:200px;
margin-top:30px;
float:left;
}
#secondColumn
{
position:relative;
margin-left:315px;
width:200px;
margin-top:30px;
float:none;
}
#thirdColumn
{
position:relative;
margin-left:650px;
width:200px;
margin-top:-30px;
float:none;
}
html:
<div id="firstColumn">
<p style="font-size:18px; color:Gray;"><b>Lorem ipsum</b></p>
<hr style="background-color:Gray; border:0.5px solid Gray" />
<p style="color:Blue; font-size:14px;">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</div>
<div id="secondColumn" >
<p style="font-size:18px; color:Gray;"><b>Lorem ipsum</b></p>
<hr style="background-color:Gray; border:0.5px solid Gray" />
<p style="color:Blue; font-size:14px;">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</div>
<div id="thirdColumn" >
<p style="font-size:18px; color:Gray;"><b>Lorem ipsum</b></p>
<hr style="background-color:Gray; border:0.5px solid Gray" />
<p style="color:Blue; font-size:14px;">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</div>