javascript - Text on the image in multiple DIVs -
i have simple css container , 3 different divs inside aligned center. in each div, there image , text above of each image . far working fine.
however, put text on each image of possible (center inside image). tried play instruction (here), couldn't work. please help!
here css:
.containercurve1 { width:90%; border:0px solid black; text-align:center; margin-left:auto; margin-right:auto; background-color:white; border-radius: 25px; padding:20px; max-height: 80%; height: 80%; height:80vh; } .imglevel1 { margin-right:15px; width:300px; height:260px; background:#b2b4b3; padding:12px; border:2px solid #ffb652; } .linkimage { text-decoration: none; }
here html:
<div class="containercurve1"> <div style='display: inline-block; vertical-align: top;'> <a href="page1.html" class="linkimage"> <span class="titlepicture">picture 1</span><br> <img src="../project_img/pic1.png" class="imglevel1"> </a> </div> <div style='display: inline-block; vertical-align: top;'> <a href="page2.html" class="linkimage"> <span class="titlepicture">picture 2</span><br> <img src="../project_img/pic1.png" class="imglevel1" > </a> </div> <div style='display: inline-block; vertical-align: top;'> <a href="page3.html" class="linkimage"> <span class="titlepicture">picture 3</span><br> <img src="../project_img/pic1.png" class="imglevel1" > </a> </div> </div>
how putting span below , using negative top margin?
.containercurve1 { width:90%; border:0px solid black; text-align:center; margin-left:auto; margin-right:auto; background-color:white; border-radius: 25px; padding:20px; max-height: 80%; height: 80%; height:80vh; } .imglevel1 { margin-right:15px; width:300px; height:260px; background:#b2b4b3; padding:12px; border:2px solid #ffb652; } .linkimage { text-decoration: none; } .titlepicture { display:block; margin-top:-150px; }
<div class="containercurve1"> <div style='display: inline-block; vertical-align: top;'> <a href="page1.html" class="linkimage"> <img src="../project_img/pic1.png" class="imglevel1"/> <span class="titlepicture">picture 1</span> </a> </div> <div style='display: inline-block; vertical-align: top;'> <a href="page2.html" class="linkimage"> <img src="../project_img/pic1.png" class="imglevel1" /> <span class="titlepicture">picture 2</span> </a> </div> <div style='display: inline-block; vertical-align: top;'> <a href="page3.html" class="linkimage"> <img src="../project_img/pic1.png" class="imglevel1" /> <span class="titlepicture">picture 1</span> </a> </div> </div>
note: click "full page" after run snippet.
Comments
Post a Comment