I have a use case, where i need to set height and width of a div based on the number of siblings, for suppose of the parent div has 3 divs inside it, then i need to set the child div's width and height as 33%, if it has 2 div's then set the width as 50% and height as 37.5% and if it has one then set the height as 50% and width as 100%. so all these percentages are based on the parent div's width.
Can anyone tell me how to achieve it using css, even if the parent has different set of element types and want to apply this css only for a certain type, i.e. div's.