CSS: Float a div on another div, Ex: Text caption on picture
2015-06-01 18:16
597 查看
<style type="text/css"> .figure { width: 316px; height: 205px; display: block; border-color: azure; position: relative; } .figure img { z-index: 0; } .figure .caption { position: absolute; left: 0; right: 0; bottom: 0; height: 22; width:inherit; display:inline-block; color: #fff; background-color: rgba(0,0,0,.5); z-index: 100; } </style>
<div class="figure"> <img src="http://img-aws.ehowcdn.com/320x208/ehow-tech-blog-us/files/2014/07/google-maps-measure.gif" alt="[Article Image] - How to Supercharge Google Maps" title="How to Supercharge Google Maps" class="image"> <div class="caption"> How to Supercharge Google Maps </div> </div>
How to Supercharge Google Maps
相关文章推荐
- css3 animation实现风车转动
- css绘制三角形方法
- 表格样式
- CSS3 transition transform
- CSS 背景图随div大小缩放 兼容IE
- CSS 判断IE并执行样式
- CSS + ul li 横向排列的方法
- 关于CSS布局的一些经验
- 10_css控制背景与css精灵.txt
- 6_css选择符详解.txt
- 5_css控制文字及链接.txt
- 4_css语法及优先权.txt
- 3_css语法.txt
- 2_css理解.txt
- 图文详解CSS的position常用的三个属性:relative,absolute以及fixed,以及嵌套使用的一个常见情况
- 25_css缩放zoom.html
- 24_css定位布局_相对定位.html
- 24_css定位布局_绝对定位.html
- 23_css清除浮动的三种方法.html
- 23_css清除浮动.html