Skip navigation.

Forestgan

CSS layout in China

Posts tagged with "caption"

一种较酷的给图片加上说明文字的方法

, ,

If The New York Times has captions on their images, why shouldn't everyone be able to have them? With the help of Image Caption, adding text to accompany regular old <img> tags couldn't be easier. Give your image a "title" -- how appropriate! -- and a class, and in less than a minute you'll have beautiful looking captions for your images.

只需要很少的JS和CSS 代码.

JS文件

CSS

.arc90_imgcaptionTXT {
color: #666;
text-align: center;

}
.arc90_imgcaption {
border: 1px solid #DDD;
padding: .5em .5em .5em;
margin: 0;

}
.floatl { float: left; margin-right: 1em; }
.floatr { float: right; margin-left: 1em; }


使用时只需在IMG的TITLE标签里加入说明文字,再加上class="imgcaption"就可.

eg:

<img class="imgcaption" src="st.jpg" width="320" height="240" 
alt="珍贵的观叶植物--苏铁<br />苏铁又称铁树、风尾蕉,苏铁科常绿木本树种 " 
title="珍贵的观叶植物--苏铁<br />苏铁又称铁树、风尾蕉,苏铁科常绿木本树种 " />


这样一来,说明文字会显示在图片的下方.

效果演示

原文
December 2009
S M T W T F S
November 2009January 2010
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31