I have a dynamic HTML structure and I want to apply a CSS rule only when exists one element that contains one specific class.
<div class="inline-container">
<div class="form-element>
<label class="paragraph">Some text</label>
<div class="select-wrapper">
<select>
<option value="1">1</option>
</select>
</div>
</div>
<input type="hidden">
<input type="hidden">
</div>
When the inputs type are enabled their structure change to the same of "form-element" and of course with the same classes. I only want to apply styles when there are one enabled like in the code. The styles that I want to apply are for the label and for the select. I have tried using only-child or only-of-type but doesn't work fine for that case.
label:only-child {
padding: 0% 29% 0% 0% !important;
}
div:only-child {
select {
padding: 0% 10% 0% 59% !important;
}
}
The HTML cannot be modified only the CSS (.less file)