css - Have a transparent when hover each images(not background) -


i have code

<div class="photo"> <img src="images.jpg"> <div class="text">its transparent</div> </div> 

i have tried css

.text{     opacity:0.8;     background-color:#ccc;     position:fixed;     width:100%;     height:100%;     top:0px;     left:0px;     z-index:1000; } 

also this

.text{     background: rgba(0, 0, 0, 0.28) none repeat scroll 0 0;     color: #fff;     position: relative;     top: -240px;     width:100%;     height:100% } 

i want text above in images(not background) transparent background. have transparent doesnt cover whole images. have tried doesnt apply me.

allow div cover whole page instead of area within container

background images: how fill whole div if image small , vice versa

have background image transparent colour

you set .photo { position: relative; } use position: absolute; .text

div.photo .text {   position: absolute;   top: 0; right: 0; bottom: 0; left: 0; } 

try on: https://jsfiddle.net/mmouze3n/1/

edit 1 -

adding blur overlay :before

div.photo .text {   position: absolute;   top: 0; right: 0; bottom: 0; left: 0;   text-align: center;   font-size: 26px;   color: #fff;   z-index: 1;   webkit-transition: .3s;   transition: .3s; } div.photo:hover .text { font-size: 100px; color: #000; }  div.photo:before {   display: inline-block;   content: '';   position: absolute;   top: 0; right: 0; bottom: 0; left: 0;   background-color:#ccc;   opacity: 0;   z-index: 0;   webkit-transition: .3s;   transition: .3s; } div.photo:hover:before {   opacity:0.8; } 

jsfiddle: https://jsfiddle.net/mmouze3n/2/


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -