from some helped from others in stackoverflow i already horizontal my text on image. Right now i want the text at center on vertical also. Thank you very guys
<body>
<div class="images">
<img src="image.jpg" id="imageid" />
<div class="texts" id="text">
<a href="#">Gallery 1</a>
</div>
</div>
.images {
position:relative;
text-align:center;
float: left;
}
.texts {
left: 0;
position:absolute;
width: 100%;
}
You can take a look into this explanatory site http://css-tricks.com/what-is-vertical-align/
You can use vertical-align:middle
property to align the image to the text.
Here is a sample http://www.w3schools.com/cssref/tryit.asp?filename=trycss_vertical-align
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.