对于div“ section1”-我正在尝试将其定位为绿色不会溢出到div“ Lnav”上。无论如何,我是否可以调整CSS,以使绿色背景色仅覆盖标题“ h1”(仅字体)?谢谢
#Lnav
{
line-height:30px;
background-color:#eeeeee;
height:300px;
width:100px;
float:left;
padding:5px;
margin:20px;
}
#section
{
width:850px;
float:center;
padding:5px;
}
#section1
{
float:center;
padding:5px;
background-color:lime;
}
div id="section">
<div id="section1">
<h1><London></h1>
<p>London is the capital city of England. It is the most populous city in the United Kingdom,
with a metropolitan area of over 13 million inhabitants</p>
</div>
</div>
<div id="Lnav">
<div id="LnavContents1">
London<br>
Chicago<br>
Bombay<br>
</div>
<div id="LnavContents2">
London<br>
Chicago<br>
Bombay<br>
[![enter image description here][1]][1]</div>
</div>
添加margin-left:20px
到#section1
CSS样式中,以将绿色区域的左边缘推入尽可能多的导航区域,使其远离左边缘。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句