日记男孩的博客

两个图片并排显示并且中间设置间距的html源代码

很久以前的时候写过一篇文章: google等联盟广告并排放置的方法

用下面的html源代码就可以将两个广告或者图片并排显示:

<table align=center><tr><td><table border="0″ align="left" style="margin-left:30px"><tr><td>
广告代码1</td></tr></table></td><td><table border="0″ align="left"
><tr><td>
广告代码2
</td></tr></table></td></tr></table>

 

但是里面可以加多一项参数,就是两个图片之间的间距,用这个代码设置图片代码的时候,会发现两张图片是紧挨在一起的,如果不想这两个图片挨的这么近,可以给其中一个图片加多一个间距的html代码:style="margin-left:30px"  。 (左侧空30个像素的距离)

数值可以根据你自己的需要进行设置。

上面修改后的完整源代码如下:

<table align=center><tr><td><table border="0″ align="left" style="margin-left:30px"><tr><td>
<a href="http://www.xxx.com" target='_blank'><img src="http://xxx.com/name.gif&type=gif" ></a></td></tr></table></td><td><table border="0″ align="left"
><tr><td>
<a href="http://www.xxx.com" target='_blank'><img src="http://xxx.com/name.gif&type=gif" style="margin-left:30px"></a>
</td></tr></table></td></tr></table>

 

完成。

 

 

 

转载请注明:日记男孩的博客 » 两个图片并排显示并且中间设置间距的html源代码

赞赏

微信赞赏支付宝赞赏

退出移动版