css - Hovered text on image with absolute position -
on image can see 3 pictures, want them hovered text. i'm pretty new in of css thingies. after hover on 1 of 3 image text appear, problem tried many thing, maybefault lays in position absolute?
html:
<div id="imgbackground"></div> <div id="imgcontainer"> <img src="images/coffee_01.jpg" /> <img src="images/coffee_02.jpg" /> <img src="images/coffee_03.jpg" /> </div>
css:
#imgbackground { position: absolute; width: 100%; height: 300px; background-color: rgb(244,244,244); } #imgcontainer { position: relative; margin: auto; width: 980px; padding: 30px; } #imgcontainer img { margin: 0px 14px 0px 14px; width: 295px; height: 254px; }
thanks guys answers haven't helped me much.
as see in code tried scretch bit need, take attention , move mouse under imgage on white space, hovering. how fix problem?
#wrapper .text { position:relative; bottom:221px; left:0px; width: 300px; height: 200px; background: rgba(0,0,0, .4); text-align: center; text-height: 50px; visibility:hidden; } #wrapper:hover .text { visibility:visible; }
here's update:
i think might cause it, ideas ?
@edit
this code page:
.imgcontainer { position: relative; margin: auto; width: 295px; height: 254px; padding: 30px; float: left; } .imgwrapper .text { position:relative; bottom:274px; top: 10px; width: 295px; height: 254px; background: rgba(0,0,0, .4); text-align: center; visibility:hidden; } .imgwrapper:hover .text { visibility:visible; }
and result on page:
Comments
Post a Comment