html - 悬停时无法更改水平标尺颜色

标签 html css

我可以在悬停时更改无序列表的背景和字体颜色。

但是,我无法让我的水平线更改为相同的颜色。

我正在努力实现与 thewhitecompany.com 相同的风格

    li {
    width: 250px;
    min-height: 300px;
    display: -moz-inline-stack;
    display: inline-block;
    vertical-align: middle;
    margin: 20px;
    zoom: 1;
    *display: inline;
    _height: 250px;
    cursor: pointer;
    -o-transition:.5s;
    -ms-transition:.5s;
    -moz-transition:.5s;
    -webkit-transition:.5s;
    /* ...and now for the proper property */
    transition:.5s;    }
li:hover {
    background-color: #746262;
    color: #ffffff;
}
li p {
    font-size: 14px;
}
li h2 {
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 2px;
}


<div style="text-align: center; vertical-align: middle;">
<li>

        <img src="http://farm4.static.flickr.com/3623/3279671785_d1f2e665b6_s.jpg" alt="lobster" width="100%" height="160"/>
        <div style="padding: 5px;">
            <h2>Product</h2>
            <hr width="80%" />
            <p>Exclusive designs by Rose Eddington<br />Including 15 notelets and envelopes</p>
            <span style="text-transform:uppercase; font-size: 12px;">Just £6.95</span>
        </div>
</li>
</div>

希望有人能帮忙,谢谢!

最佳答案

JSFiddle Demo

添加

CSS

li:hover hr { border-color:orange }

关于html - 悬停时无法更改水平标尺颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17255484/

相关文章:

html - 容器内的 Div 宽度大于容器宽度

javascript - Chrome javascript 弹出窗口尺寸错误

jquery - 用于设置溢出滚动的 CSS 不起作用

javascript - php : transfering variables from Ajax to php 中的未定义索引

javascript - 需要使用 javascript 在 <circle> 标记中设置 r(radius) 的值

html - 在悬停时显示,但仅在悬停的元素上显示

html - 我怎样才能在 <ul> 链接中有更大的圆圈

css - 谷歌浏览器正在改变 css 行为

javascript - ionic Angular : dynamic styling on cards

css - Safari 子菜单导航错误