简体   繁体   English

悬停状态的CSS边框

[英]CSS border in hover state

Essentially i have a pricing table with the class of .priceblock , and i have a border-bottom on my <li> tags, i simply want it to change color when i hover on the priceblock . 本质上,我有一个定价表,其类为.priceblock ,并且我的<li>标签上有一个border-bottom ,当我将鼠标悬停priceblock上时,我只是希望它更改颜色。 The code to me seems correct but nothing changes. 在我看来,代码正确无误。

Heres the initial li tag: 这是初始的li标签:

ul.pricingtable .priceblock .contents li {
    font-family: 'OpenSans';
    font-size: 13px;
    width: 81.904762%;
    height: 35px;
    margin:0 auto;
    padding: 10px 0;
    border-bottom: 1px solid rgba(221,221,221,1);
}

And here hover state css code, this hover class works for he coloring of texts, but i can't change the border color. 在这里, 悬浮状态css代码,此悬浮类适用于他为文本着色,但是我不能更改边框颜色。

.priceblock:hover .contents li {
    border-color: rgba(255,117,109,1);
}

Any ideas? 有任何想法吗?

I think you might need to change the hover state from. 我认为您可能需要更改悬停状态。

    .priceblock:hover .contents li {
    border-color: rgba(255,117,109,1);
    }

To: 至:

.contents li:hover {
    border-bottom: 1px solid rgba(255,117,109,1);
}

HTML may be able to read it better. HTML也许能够更好地阅读它。

The css attributes need to be equals. css属性必须相等。

for example: 例如:

If in the first style block you write "ul.pricingtable" then you need to do that in the second block two. 如果在第一个样式块中写入“ ul.pricingtable”,则需要在第二个样式块中执行此操作。

And in the content of block, they need to be same. 并且在块的内容中,它们必须相同。

for example: 例如:

border-bottom: 1px solid rgba(221,221,221,1);

and

border-bottom: 1px solid rgba(255,117,109,1);

You cann'ot use once with "border-bottom" and then with "border-color" only... 您不能一次使用“ border-bottom”,然后再使用“ border-color” ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM