我有html。恩。像這樣:如何除了div中的所有元素CSS與類?
<form class="smart-form">
<div>
<p></p>
<i></i>
<div>
<span class="classname"><b>text</b></span>
</div>
</div>
</form>
而且有CSS代碼爲所有表單元素,但我需要除此規則這是內部.classname的所有元素:
.smart-form *,
.smart-form *:after,
.smart-form *:before {
margin: 0;
padding: 0;
box-sizing: content-box;
-moz-box-sizing: content-box;
}
我想是這樣的:
.smart-form *:not(> .classname *) {} // but its wrong
但我需要所有與class =「noStyle」元素內的元素.... – Haroldas
@Haroldas對不起,我不明白在這個問題。我會更新我的答案。抓緊! –
@Haroldas我更新了我的答案。 –