How can I make an image when I move the mouse, does a text appear in the center of the image? with css code, or other.
How can I make an image when I move the mouse, does a text appear in the center of the image? with css code, or other.
you can do as follows:
figure {
float: left;
position: relative;
}
figure figcaption {
display: none;
color: white;
font-size: 24px;
font-weight: bold;
}
.center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
figure:hover figcaption {
display: block;
}
<figure>
<img src="http://html5doctor.com/wp-content/uploads/2010/03/macaque.jpg"alt="Macaque in the trees">
<figcaption class="center">A cheeky macaque, Lower Kintaganban River, Borneo.</figcaption>
</figure>