I am facing an issue where I need the question mark div to be positioned right next to the top row of text in the label it is associated with. Can someone suggest some styles that can be applied to the label to adjust the width and spacing so that it matches the inner text perfectly? Click here for a screenshot of the problem
Below is the HTML code (working in Angular) where the display flex on the container div is causing the question mark to stay on the same line:
<div class="component-container">
<input
[attr.aria-labelledby]="labelText"
class="checkbox-{{ checkboxSize }}"
type="checkbox"
[checked]="checked"
[id]="checkboxId"
[disabled]="disabled"
(change)="onCheckboxChange($event)"
/>
<label
aria-hidden="true"
[for]="checkboxId"
class="font-{{ labelSize }} {{ labelColor }} {{ fontClass }}"
>{{ labelText }}</label>
<div class="extra-content">
<ng-content></ng-content>
</div>
</div>
I have tried giving the label element the style word-break: break-all
but I prefer to keep the label breaking on words. I also experimented with different display properties on both the label and parent div, as well as various flex-shrink and flex-wrap styles, without any success...