<div class="box">
<p class="img">
<img src="hogehoge.png" alt="hoge" />
</p>
<p class="title">
テストテキストです。
</p>
</div>
<style>
.box{
width: 80px;
height: 80px;
position: relative;
}
.img{
width: 100%;
height: 100%;
position: relative;
}
.img:after{
width: 100%;
height: 100%;
position: absolute;
content: '';
display: block;
top: 0;
right: 0;
background: -moz-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(51,51,51,0) 35%, rgba(51,51,51,0.2) 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(51,51,51,0) 35%,rgba(51,51,51,0.2) 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom, rgba(255,255,255,0) 0%,rgba(51,51,51,0) 35%,rgba(51,51,51,0.2) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#33333333',GradientType=0 );
}
.title{
width: 100%;
position: absolute;
left: 0;
bottom: 0;
}
</style>
CSS3
画像の上に乗せた白文字を見やすくする C0d3man52