我有以下代码:改变色块悬停和点击(并保持活跃)
如何编辑我的CSS在这样一种方式,.pricing客户的背景将变为一个color:#333
和所有我的段落样式将更改为另一个color:#fff
当我徘徊.pricing-customer
块。因为现在如果我将鼠标悬停在块上,它只会改变背景,而段落样式只会在我将鼠标悬停在段落上时发生变化。我怎样才能使.pricing-customer
的颜色和所有我的段落在点击时改变? (为相同的颜色为上悬停)
.pricing-customer {
background: #fff;
min-height: 250px;
cursor: pointer;
transition: all .3s ease-in-out;
margin-bottom: 20px;
padding: 10px 0px 25px 0px;
}
p.pricing-number {
font-size: 52px;
margin-bottom: 10px;
margin-top: 20px;
color: #fead0d;
}
p.pricing-monthes {
color: #5e6977;
font-size: 14px;
line-height: 21px;
padding-bottom: 20px;
border-bottom: 1px solid #e1e8ee;
}
p.emails {
color: #444;
font-size: 16px;
line-height: 21px;
}
<div class="pricing-customer col-sm-12 col-sm-3 text-center">
<h3><?php echo $t_title; ?></h3>
<p class="pricing-number">$ 70</p>
<br>
<p class="pricing-monthes">per week/month</p>
<p class="pricing-emails">100 000 emails</p>
</div>
预先感谢您
请检查此链接:-https://css-tricks.com/almanac/selectors/a/active/ –