Div+css代码实现图片的并列连接的效果
星期六, 八月 29, 2009 18:02
1,013次浏览 暂无评论
- Div + Css的代码
今天打开FireFox,发现我们公司的网站一个广告栏飞到右侧去了。我想是使用了表格的缘故。网站是基于Div+css做的,但是自己对DIV建站水平不足,很多地方还保留了TD TR的表格。下决心修改了一下,现在没有不会飞到右侧了。这个代码的作用:在photoshop割图后,要用div接拼起来,实现几张图片的连接效果。对代码进行记录:
- #adimglist
- img{
- float:left; /*定义浮动到左侧,这样就可以实现几个连接的图片的并列了*/
- margin: 0;/*定义图片的边框为零*/
- }
显示效果
- <style>
- #adimglist
- img{
- float:left;
- margin: 0;
- }
- </style>
- <div id="adimglist"><a href="http://www.yanwotang.com/catalog_160.html" target="_blank"><img src="http://www.yanwotang.com/syssite/home/shop/1/template/Cn00016/images/tupian_01.jpg" alt="正官庄高丽参" width="155" height="150" border="0"></a>
- <a href="http://www.yanwotang.com/product_140.html" target="_blank"><img src="http://www.yanwotang.com/syssite/home/shop/1/template/Cn00016/images/tupian_02.jpg" alt="顶级白燕条皇" width="125" height="150" border="0"></a>
- <a href="http://www.yanwotang.com/product_114.html" target="_blank"><img src="http://www.yanwotang.com/syssite/home/shop/1/template/Cn00016/images/tupian_03.jpg" alt="三角白燕盏" width="130" height="150" border="0"></a>
- </div>
