我試圖將此CSS規則: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")
。 It works in 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>
據我所知,沒有什麼是壓倒一切的規則:
任何想法?謝謝!
它看起來像'#survey li {padding:0 5px; ''重寫它。我錯過了什麼嗎? – Eric
發送在線鏈接。 – Nitesh
OT,微優化:'ul'元素只能有'li'子元素,所以你可以安全地用':nth-child()'替換':nth-of-type()''' – FelipeAls