0

我有一个幻灯片,我能够让描述以黄色显示,这是我想要的。

但是描述上方的标题 (H2) 是不可见的,除非您将鼠标悬停在它上面。我目前有这个作为我的 CSS:

.slideshow_container { background: #000; }
.slideshow_container a { text-decoration: none; }
.slideshow_container .slideshow_slide { margin-right: 2px; }
.slideshow_container .slideshow_slide_text h2 { color: #FFFFFF; text-align: left; 
font-size: 1.3em; }
.slideshow_container .slideshow_slide_text p { color: #FFFF00; 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: #FFFFFF; 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-weight: bold; }
.slideshow_container .slideshow_transparent { filter: alpha(opacity = 50); opacity: 0.5; }
.slideshow_container .slideshow_transparent:hover { filter: alpha(opacity = 80); opacity: 
0.8; }

的HTML:

<div class="slideshow_container slideshow_container_slideshow-jquery-image-gallery-custom-
styles_1" style="height: 600px; max-width: 660px;" data-session-id="0"><div
class="slideshow_controlPanel slideshow_transparent"><ul><li
class="slideshow_togglePlay"></li></ul></div><div
class="slideshow_button slideshow_previous slideshow_transparent"></div><div
class="slideshow_button slideshow_next slideshow_transparent"></div><div
class="slideshow_pagination"><div
class="slideshow_pagination_center"></div></div><div
class="slideshow_content" style="display: none;"><div
class="slideshow_view"><div
class="slideshow_slide slideshow_slide_image"> <a
target="_self" > <img src="http://www.occupyhln.org/wp-content/uploads/2013/07/Audrey-    
Edmunds.jpg" alt="Audrey Edmunds" width="1000" height="588" /> </a><div
class="slideshow_description slideshow_transparent">
<h2><a target="_self" >Audrey Edmunds</a></h2>
<p><a target="_self" >Here, Audrey Edmunds poses at the John C. Burke Correctional Center 
in Waupun, Wis., 10 years into serving her 18-year conviction and sentence for shaking a 
baby to death, while babysitting. She was freed in Feb., 2008 after an appeals court said 
new research into the syndrome cast doubt on her guilt. According to Northwestern 
University's Center on Wrongful Convictions, experts asserted that symptoms they once 
thought were proof of Shaken Baby Syndrome can be from other causes, including accidents, 
illness, infection, old injuries, and congenital defects.</a></p>
</div></div><div style="clear: both;"></div></div>

段落部分似乎运行良好,描述显示为黄色。但我想让标题显示为白色,以便突出显示。目前,您必须将鼠标悬停在段落上方的标题上才能看到它们。

你可以在这个特定的页面上看到杂耍……我试图触发它,但似乎没有任何效果。

在这方面的任何指导将不胜感激!

4

2 回答 2

2

这完全是关于特异性 Id 覆盖任何类。

你有一个规则#content h2 a, #content h2 a:visited,正如我所说的覆盖你的.slideshow_container .slideshow_description h2选择器

在此处阅读有关特异性的更多信息。

于 2013-07-02T17:19:24.287 回答
1

看起来这种风格#content h2 a优先并用#111111

由于您使用id带有该样式的 an ,因此它会覆盖此样式.slideshow_container_style-dark .slideshow_description a

您也不应该在h2链接标签 ( a) 中包含文本。这就是您上面的代码段无法识别的原因:.slideshow_container .slideshow_description h2

要解决此问题,您可以尝试以下操作:#content .slideshow_container .slideshow_description h2 a. 这有点难看,但应该可以。

于 2013-07-02T17:17:51.717 回答