答案 0 :(得分:2)
答案 1 :(得分:1)
demo http://jsfiddle.net/AMcnZ/22/
第二次演示http://jsfiddle.net/AMcnZ/32/
.boxcaption{
float: left;
position: absolute;
background: #000;
height: 25px;
width: 100%;
opacity: .6;
padding-top:3px;
text-align:center;
/* For IE 5-7 */
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=60);
/* For IE 8 */
-MS-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)";
}
答案 2 :(得分:0)
以下是您可以使用CSS&得到结果:http://jsfiddle.net/surendraVsingh/AMcnZ/31/
从height
删除.boxcaption
。
.boxcaption{
float: left;
position: absolute;
background: #000;
width: 100%;
text-align:center; /*Add this*/
padding:5px 0 0 0; /*Add this*/
opacity: .6;
/* For IE 5-7 */
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=60);
/* For IE 8 */
-MS-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)";
}