I have a component that has a label and a sub-label. We are using Tailwind-ui. Normally it displays like so:
<label>
<p>Label</p>
<p>Sublabel</p>
</label>
Label
Sublabel
I am using flexbox to stack it as a column:
.label {
display: flex;
flex-direction: column;
}
We just got a request to allow the sublabel to be positioned inline with the label, but I'm facing an issue where, since flexbox obviously simply shifts the "box" of the sublabel next to the label, the two labels wrap strangely when they're long, like so:
this is the this is the
main label sublabel
Is there a way using css to have the two labels wrap as if they were a single sentence, like so?
This is the main label this is
the sublabel
Or is the only option to have a conditional html setup for inline vs stacked labels where the text is in the same P tag?