我在这个CSS中错误地使用了选择器吗?有问题让h2改变颜色

时间:2013-07-03 03:11:27

标签: css css3 colors hyperlink css-selectors

我对CSS和选择器很恐怖。有可能弄清楚我可以用什么作为CSS来实现我的目标吗?

具体来说,我希望奥黛丽·埃德蒙兹能够大胆而黄色,但无论我尝试什么,我似乎无法让它发挥作用。

Audrey Edmunds

然而,无论我尝试什么,这个人的名字仍然显示为几乎透明,除非你将鼠标悬停在它上面(就在描述之上),然后是浅蓝色。

这是我在the page I'm having issues with上使用的当前CSS:

.slideshow_container { background: #000; }

.slideshow_container a { color: white; text-align: left; font-size: 1.3em; text-decoration: 
none; }

.slideshow_container .slideshow_slide { margin-right: 2px; }
.slideshow_container .slideshow_slide_text h2 { color: white; text-align: left; font-size: 
1.3em; }
.slideshow_container .slideshow_slide_text p { color: white; font-weight: bold; text-align: 
left; }
.slideshow_container .slideshow_slide_image { }
.slideshow_container .slideshow_slide_video { }

.slideshow_container .slideshow_description { background: #000; width: 100%; }
.slideshow_container .slideshow_description h2  { color: white; font-size: 1.3em; 
text-align: left; }
.slideshow_container .slideshow_description p  { color: #FFFF00; font-size: 1.1 em; 
font-weight: bold; text-align: left; }
.slideshow_container .slideshow_description a  { color: #FFFF00; font-size: 1.1 em; 
font-weight: bold; text-align: left; }

感谢任何人提供的任何指导!

1 个答案:

答案 0 :(得分:1)

为了让它按照你想要的方式工作,你可以这样做:

.slideshow_description.slideshow_transparent h2 a {
    color: #FFFF00 !important;
    font-weight: bold;
}

或者这个更好,因为它不使用!important

#content .slideshow_description.slideshow_transparent h2 a
{
    color: yelllow;
    font-weight: bold;
}