Would the proportions of the image have anything to do with the problem?
#menu {
background: black;
width: 100%;
height: 45px;
}
#menu ul {
text-decoration: none;
list-style-type: none;
}
#menu li {
text-decoration: none;
display: inline;
font-size: 30px;
padding-left: 30px;
}
#menu a:hover {
background-image: url(images/hover.png);
}
#menu a {
text-decoration: none;
color: white;
margin: auto
background-repeat: bo-repeat;
background-position: top center;
background-size: contain;
}
On hover it repeats the images multiple times. The image is 2000 x 500 px. How can I make it so that this image is displayed behind the word in the middle and not repeat. Thank you
This is the image hover link
the html code
<div id="menu">
<ul>
<li><a href="index.html"> Home</a></li>
<li> <a href="#"> lalal</a></li>
</ul>
</div>
You should set the text parameters like this:
#menu ul li a:hover
{
background-image: url(http://img.mynet.com/ha2/tayyip.jpg);
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments