I have the following CSS rules:
#div .item62 > .wrap > .cont > .level1 > div:nth-child(9),
#div .item62 > .wrap > .cont > .level1 > div:nth-child(11),
#div .item62 > .wrap > .cont > .level1 > div:nth-child(n+12){
width: 140px ;
}
I would like to group those rules to make the code shorter and probably to make the code more efficient when the parent element selection would be done once(do those rules make the browser engine search three times the same "parent" element or is this already optimized?).
Is there a way to write these rules in a shorter way?
As the code structure is created by third party code I cannot add a distinct class or change HTML structure.
I could not find a CSS method that would allow to select one parent with multiple distinct child elements without rewriting the whole path to the child elements. Also I have no additional CSS preprocessors avaliable.
Your current CSS rule is the shortest you can write without any Preprocessor available.
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