CSS: Float a div on another div, Ex: Text caption on picture

本文介绍了一系列增强谷歌地图使用体验的方法,包括如何利用谷歌地图进行精确测量等实用技巧。
<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>
[Article Image] - How to Supercharge Google Maps
How to Supercharge Google Maps

 

转载于:https://www.cnblogs.com/feika/p/4544609.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值