I am desperately trying to put a h1 element right by the side of a checkbox, and I can't seem to do it.

    <lightning-input onchange={select} type="checkbox" name={index}></lightning-input>
    <h1>Promo: <span style="font-weight: bold;">{promotion.name}</span></h1>

I tried changing the display of the checkbox to block, then I tried that with both the h1 and input elements, and then tried with a inline-block display and it didn't do anything. The input takes the whole line and the h1 appears below. How can I achieve this?

  • 1
    Would <div style="display:flex;"> do the trick on your div?. Also keep in mind that the label is required, and if you don't want it you may use variant="label-hidden" together with the label Mar 3 at 14:39
  • I'll try that! And i'll add the label, thanks Mar 3 at 14:57

So, Sergio Alcocer's answer works. adding a display:flex to the div containing the input and the h1 did the trick. Thanks Sergio!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.