I'm working with Sharepoint at the moment and to say it's code structure/layout is a mess would be a huge understatement. It has a left navigation, and I want all items in there to be styled with a div around them (I'd target them individually, but Sharepoint has hundreds of widgets each with their own name class), for example:
<div id="leftNav">
<div id="widget1">
<div></div>
<div></div>
</div>
<div id="widget2">
<div></div>
<div></div>
</div>
</div>
I've tried #leftNav div { }
but that targets the sub divs too (and the sub divs of those divs) - is there anyway to just target the 'widget' divs?
Thanks!
Use the direct child combinator, >
:
#leftNav > div {
/* ... */
}
You can use the child selector to target the direct child of the elements.
#leftNav > div
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With