Css hover over link to fill background

What I want:

When I hover over the link, it should fill a background with a fixed-width background color (say 225px). Link text length should not be considered.

How can I achieve this?

+2


a source to share


2 answers


a:hover {background: url('some225pxWideImage.jpg') no-repeat;}

      



+3


a source


HTML:

<a class="someclass">Some link</a>

      



CSS

a.someclass {
    display: block;
    width: 225px;
}

a.someclass:hover {
    background-color: #123456;
}

      

+3


a source







All Articles