Trouble aligning checkbox/radio box in form

Hi there,

Uber beginner here. I was hoping there was an easy solution to alignment issues I’m having with checkboxes in my form:

The checkboxes appear to be center aligned, with left-aligned labels on the next line.

I’d like the checkbox to be left aligned, with the text next to it (like normal).

I had a look at some similar issues; unfortunately those solutions weren’t applicable.

Here is a preview of the page, but let me know if you need anything else: *Removed

Thanks in advance.

Hi @LLi ,

The problem is that you have the following styling:

.hs-input, .hs-search-field__input, #hs-pwd-widget-password {
 display: inline-block;
 width: 100% !important; // Here is your issue
 vertical-align: middle;
 font-family: inherit;
 font-size: inherit;
 line-height: inherit;
 border: 1px solid;
 color: #000;
 background-color: #fff;
 height: 24px;
 padding: 1px 4px;
 font-weight: 400;
}

By setting width:100% !important; to the .hs-input class you also gave the checkbox a 100% width, which causes it to be above the label instead of next to it. You could fix this by try adding the following code:

.hs-form-checkbox .hs-input {
 width: auto !important;
 margin-right: 0.5rem;
}

But it might be better to only increase the width of the .hs-input you want to have a 100% width. So you could also refactor your code to only increase the width of text, number and other inputs.

You can check the HTML of your form and should see a lot of wrappers with a classes something like this:

  • hs-fieldtype-number
  • hs-fieldtype-textarea
  • hs-fieldtype-text

So you can choose, use the code above and overwrite your styling for the hs-input class or rewrite your CSS to only set the width: 100%; for specific form fields.

Thanks so much! This solved my issue.