我正在尝试应用此 CSS 规则:
.question.paragraph .question_choices li:nth-of-type(1)
{
padding-bottom: 500px;
}
它在控制台中工作:$(".question.paragraph .question_choices li:nth-of-type(1)").css("padding-bottom", "500px")
. 它适用于 jsfiddle。它在浏览器中不起作用。我在谷歌浏览器中,所以nth-of-type
应该可以识别伪类。我检查了用户代理。我不在IE模式。这是(简化的)HTML:
<html class="no-js" lang="en"><!--<![endif]-->
<head>
<style type="text/css" media="screen" id="study_custom_style_applier">
.question.paragraph .question_choices li:nth-of-type(1)
{
padding-bottom: 500px;
}
</style>
</head>
<body style="margin-left: 300px;">
<div id="plain-container" style="margin-top: 128px;">
<div id="body">
<div class="question paragraph" id="question_211681">
<span class="question_label">p6_q1_Topic_2</span>
<div class="question_title">
Topic 2
</div>
<div class="question_choices">
<ul>
<li>stuff1</li> <!-- the rule should apply here - there should be 500px of bottom padding -->
<li>stuff2</li>
</ul>
</div>
</div>
</div>
</div>
</body>
</html>
据我所知,没有什么可以凌驾于规则之上:
有任何想法吗?谢谢!