Is it possible to include “sibling” in css selector?
Case:
1)
<div>
<textarea/>
<input/>
</div>
2)
<div>
<textarea/>
<input style="display:none;"/>
</div>
Styles:
div > texarea {
height: 100%;
width: 100%;
bottom-padding: 20px;
....
}
div > input {
bottom: 0px;
....
}
In both cases I want textarea fits the parent div. But in first case input should be at the bottom of the div, So I use bottom-padding. How to be in second case?
CSS currently dosen’t support styling parents based on some condition of it’s child(s).
I suggest you put a class on your parent DIV based on whats in it, and style the DIV based on that class.