I made an image on which some text apears when I hover the mose over it. I need to move the text in the middle of the image, but I can't find out how.
This is my code:
.home{
background-image: url("https://www.cvikovacek.cz/wp-content/uploads/2017/08/domecek-270x300.png");
height: 300px;
width: 300px;
background-size: cover;
font-size: 30px;
text-align: center;
}
.home:hover{
background: black;
}
.home:hover::after{
content: "HOME";
color: green;
}
<body>
<div class="home"></div>
</body>
Thanks for any answer.