Skip to content

Instantly share code, notes, and snippets.

@naturallucky
Created May 11, 2016 02:15
Show Gist options
  • Save naturallucky/284537c7674f4c224ed958898889fbab to your computer and use it in GitHub Desktop.
Save naturallucky/284537c7674f4c224ed958898889fbab to your computer and use it in GitHub Desktop.
opacity overlap label css(essence)
.base{
position:relative;
}
.base .overlapcaption{
position: absolute;
background-color: rgba( 222, 200, 200, 0.8 );
/*キャプションの形と位置*/
top: calc(100% - 12px);
top: -webkit-calc(100% - 12px);
left: 0;
width: 100%;
}
<div class="base">
<img src="https://s0.wordpress.com/mshots/v1/https%3A%2F%2Fblender.jp%2F?w=250&#038;h=250"
alt="blender" width="250" height="250" class="alignnone" />
<div class="overlapcaption">
イメージキャプション
</div>
</div>