Francis Gallagher Francis Gallagher - 4 months ago 11
CSS Question

how to select the 2nd child Div of a div using CSS

I am trying to style a div in wordpress. As you cant give anything IDs I have to select to using CSS3

:nth-child()
Selector. I am trying to target the third div
My css rules I am trying but it not working any ideas where I am going wrong

#ninja_forms_form_175_all_fields_wrap:nth-of-type(2) {
padding: 0px;
}


<div id="ninja_forms_form_175_all_fields_wrap" >
<div class="ninja-row">
<div class="ninja-col-1-2">

Answer

try this: #ninja_forms_form_175_all_fields_wrap>div:first-of- type>div: first-of-type