I have an element that may contain 1, 2 or 3 subelements:
<div class="wrapper">
<div class="element" />
</div>
or...
<div class="wrapper">
<div class="element" />
<div class="element" />
</div>
or...
<div class="wrapper">
<div class="element" />
<div class="element" />
<div class="element" />
</div>
I want to apply styles to .element depending on how many siblings there are.
For example, something like...
.wrapper .element {
width: 50%;
}
.wrapper .element:only-child {
width: 75%;
}
...but I cannot figure out how to differentiate between the 2 elements and the 3 elements. Is this possible in pure css?
Thanks ( in advance ) for your help.