【发布时间】:2011-07-05 11:01:39
【问题描述】:
我正在制作一些标签,使用背景图片作为悬停状态背景。唯一看起来不错的是“Day”。我想,因为它只有 3 个字符,而其他选项卡是 4 个字符。有没有办法让悬停背景以它们为中心?这是列表的 css。
li {
font: 9pt "Helvetica Neue", Helvetica, Arial, "Trebuchet MS", Trebuchet, serif;
margin-top: .192333333em;
float: right;
height: 19px;
width: 40px;
margin-left: 10px;
display: inline-block;
margin: 7px;
}
li.current {
background: url('img/red-current-bg.png') no-repeat;
line-height: 1.6em;
}
ul#tabnav {
margin: 0;
}
ul#tabnav li a {
text-shadow: 0 1px #800000;
text-decoration: none;
padding: 8px 11px;
line-height: 1.6em;
}
ul#tabnav li:hover {
background: url('img/red-current-bg.png') 0 0 no-repeat;
}
【问题讨论】:
标签: css hover html-lists