开发者

CSS hover upon a link to fill background

开发者 https://www.devze.com 2022-12-30 01:02 出处:网络
What I want: When I hover upon a lin开发者_如何学Ck it should fill the background with a fixed width (say 225 pixels) background color.

What I want:

When I hover upon a lin开发者_如何学Ck it should fill the background with a fixed width (say 225 pixels) background color. The length of the text of the link should not be considered.

How can I achieve this?


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


HTML:

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

CSS:

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

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

精彩评论

暂无评论...
验证码 换一张
取 消