日期:2014-05-17  浏览次数:20535 次

请教关于span左边框的问题
<html>
<head>
<style type="text/css">  
</style>
</head>

<body>

<div style="width:80px;height:200px;border:1px red solid">
<span style="margin-left:20px;width=100px;">这个段落带有指定的左外边距。</span>
</div>
</body>

</html>

里面SPAN 宽度超过外边的DIV 换行后 margin left 失效


知道SPAN是行内元素 让我换DIV的兄弟先谢谢了

------解决方案--------------------
<html>
<head>
<style type="text/css">
</style>
</head>

<body>

<div style="width:80px;height:200px;border:1px red solid">
<span style="margin-left:20px; display:block;">这个段落带有指定的左外边距。</span>
</div>
</body>

</html>



楼主 这个意思?
------解决方案--------------------
探讨

<html>
<head>
<style type="text/css">
</style>
</head>

<body>

<div style="width:80px;height:200px;border:1px red solid">
<span style="margin-left:20px; display:block;">这个段落带有指定的左外边距。</s……

------解决方案--------------------
探讨

引用:

<html>
<head>
<style type="text/css">
</style>
</head>

<body>

<div style="width:80px;height:200px;border:1px red solid">
<span style="margin-left:20px; display:block;">这个段落……