<div id="new">
<div id="zhan"></div>
<div id="ad">放广告代码</div>
内容标签
</div>
CSS部分:
#zhan{
float: left;
clear: left;
height: 200px;
width: 1px;
}
#ad{
height: 250px;
width: 250px;
float: left;
clear: left;
margin: 15px 15px 15px 0px;
}
#new img,#new table{
clear: left;
}
#new{
float: left;
}
CSS部分:cqnhhi
#zhan{cqnhhi
float: left; /让块靠左cqnhhi
clear: left; /让块的左边不能有其它块cqnhhi
height: 200px; /用这个来控制广告在内容里的位置cqnhhi
width: 1px; /cqnhhi
}cqnhhi
#ad{cqnhhi
height: 250px;cqnhhi
width: 250px;cqnhhi
float: left; /让块靠左cqnhhi
clear: left; /让块的左边不能有其它块cqnhhi
margin: 15px 15px 15px 0px;cqnhhi
}cqnhhi
#new img,#new table{cqnhhi
clear: left; /让内容里的图片和表格不会遮挡广告cqnhhi
}cqnhhi
#new{cqnhhi
float: left;cqnhhi
}
将下面的广告代码放在文章的开头:
<div style="float:left; height:336px; width:1px; clear:left;"></div>
<div style="float:left; height:336px; width:280px; clear:left; margin: 5px 5px 5px 0px;">您的广告代码</div>
这个是三面环绕。
二面环绕只需把第一个广告div区去除即可:
<div style="float:left; height:336px; width:280px; clear:left; margin: 5px 5px 5px 0px;">您的广告代码</div>
实际上把广告的div标签改为span标签或p标签都是可以的。