DIV+CSS图文混排的方法



DIV+CSS图文混排的方法

效果:

DIV+CSS图文混排的方法

写在<body></body>

<div id=”cont”>
<img src=”images/gsjs_16.jpg”  width=”262″ height=”202″/> 

图片存放地址、尺寸、class=”left”在下面
<p>

文章内容
</p>
</div>

写在CSS


.left {

   float: right; 
   margin: 10px 0 0 10px;  
}

#cont{ margin:0; padding:0;}
#cont p{ padding:25px 0 0 0;display: inline; width:700px; line-height:25px}

padding 文字的位置

display 术语:用该值将从对象中删除行  嘻嘻(自己没理解我的翻译是:有它就环绕了,没它就不行了)

width 宽度

lin-height 行高

 

http://blog.sina.com.cn/s/blog_44e2b7eb0100fgmi.html