作者:王士伟
出处:缘定沧桑居——http://hi.baidu.com/tblc
应网友之请,将几个常用的插入图片的代码给大家,大家只需将相应代码添加到CSS中即可得到下面的效果。大家需要将代码中的网址,换为自己想插入图片的网址。由于图片大小不定,所以可能需要调整下面两个参数,以求和页面搭配和谐:
padding-bottom: 22px; margin-bottom: 6px; 改后面数字即可,padding-bottom为距上高度,margin-bottom为距下高度。
下面就是具体代码和其实现效果截图:
图片显示位置——个人档案照片下面:
#m_pro div.act{margin-top:5px; background:url(http://hiphotos.baidu.com/1077/pic/item/0365c813bd3b2c23dc540120.jpg) no-repeat bottom; padding-bottom: 22px; margin-bottom: 6px; }no-repeat bottom; padding-bottom: 22px; margin-bottom: 6px; }
个人档案照片下面效果:
个人档案照片下面效果:
图片显示位置——文章列表1:
#m_blog div.tit{font-size:14px;font-weight:bold; background:url(http://hiphotos.baidu.com/1077/pic/item/0365c813bd3b2c23dc540120.jpg) no-repeat bottom; padding-bottom: 22px; margin-bottom: 6px; }
效果:

图片显示位置——文章列表:
#m_blog div.tit{font-size:14px;font-weight:bold; line-height:24px; text-indent:120px; background:url(http://hiphotos.baidu.com/1077/pic/item/0365c813bd3b2c23dc540120.jpg) no-repeat; }
效果:

图片显示位置——文章列表:
#tabline{top:89px; background:url(http://hiphotos.baidu.com/1077/pic/item/0365c813bd3b2c23dc540120.jpg) no-repeat bottom; padding-bottom: 32px; margin-bottom: 6px; }
效果:

图片显示位置——相册下面:
#m_album div.image{text-align:center; background:url(http://hiphotos.baidu.com/1077/pic/item/0365c813bd3b2c23dc540120.jpg) no-repeat bottom; padding-bottom: 45px; margin-bottom: 1px; }

图片显示位置——每个友情链接下面:
#m_links div.line{margin-top:5px;line-height:8px;border-top:1px solid #F4C1B5; background:url(http://hiphotos.baidu.com/1077/pic/item/0365c813bd3b2c23dc540120.jpg) no-repeat bottom; padding-bottom: 16px; margin-bottom: 10px; }

图片显示位置——每个最新评论下面:
#m_comment div.item{color:#000000;font-size:12px; background:url(http://hiphotos.baidu.com/1077/pic/item/0365c813bd3b2c23dc540120.jpg) no-repeat bottom; padding-bottom: 22px; margin-bottom: 6px; }
效果:

图片显示位置——每个文章分类下面:
#m_artclg div.line{margin-top:5px;line-height:8px;border-top:1px solid #F4C1B5; background:url(http://hiphotos.baidu.com/1077/pic/item/0365c813bd3b2c23dc540120.jpg) no-repeat bottom; padding-bottom: 16px; margin-bottom: 10px; }
效果:

图片显示位置——其他区域:
#comm_info div.line{margin-top:5px;line-height:8px;border-top:1px solid #BBC1C6; background:url(http://hiphotos.baidu.com/1077/pic/item/0365c813bd3b2c23dc540120.jpg) no-repeat bottom; padding-bottom: 22px; margin-bottom: 6px; }
效果:

新加图片显示位置——个人控制条中间:
#tabline{margin-top:-131px;right:5px;line-height:8px; background:url(http://counter.skywebhosting.com/cgi-bin/Count.cgi?display=date&ft=3&dformat=yymmdd) no-repeat bottom; padding-bottom: 40px; margin-bottom: 10px}/*个人控制条日期显示*/
