Answer the question
In order to leave comments, you need to log in
How to style the 6th diva?
Hello,
There are a number of divs
<div class="fieldset"></div>
<div class="fieldset"></div>
<div class="fieldset"></div>
<div class="fieldset"></div>
<div class="fieldset"></div>
<div class="fieldset"></div>
<div class="fieldset"></div>
Answer the question
In order to leave comments, you need to log in
.fieldset:nth-child(6) {...}
on or with jquery:
$(document).ready(function(){
$(".fieldset:eq(6)").addclass(".newclass"); // добавить CSS класс
// или
$(".fieldset:eq(6)").css({"background":"eee"}); // закрасить 6 блок серым
});
<div class="fieldset"></div>
<div class="class"></div>
<div class="fieldset"></div>
<div class="fieldset"></div>
<div class="fieldset"></div>
<div class="class"></div>
<div class="fieldset"></div>
<div class="fieldset"></div>
<div class="fieldset another-class1"></div>
<div class="fieldset"></div>
<div class="fieldset"></div>
<div class="fieldset"></div>
<div class="fieldset another-class2"></div>
<div class="fieldset"></div>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question