I persisted with the columns classes and got it working. The use of columns class allows you to use the convenient is-half
class that applies to a column.
First use the following override style to help with spacing:
<style>.small-padding{padding-top:0}</style>
Then include this new small-padding
class with the column class to get nicely spaced input boxes:
<fieldset>
<div class="columns is-mobile is-multiline">
<div class="column is-half small-padding"><input name="fname" class="input" placeholder="First Name..." required></div>
<div class="column is-half small-padding"><input name="lname" class="input" placeholder="Last Name..." required></div>
<div class="column is-full small-padding"><input name="email" type="email" class="input" placeholder="Email Address..." required></div>
<div class="column is-full small-padding"><label>Address</label><input name="address" class="input" placeholder="Full Address..."></div>
<div class="column is-full small-padding"><input name="city" class="input" placeholder="Suburb..."></div>
<div class="column is-half small-padding"><input name="state" class="input" placeholder="State..."></div>
<div class="column is-half small-padding"><input name="postal_code" class="input" placeholder="Postcode..."></div>
</div>
</fieldset>
Notes
Only required one custom class to override padding-top: .small-padding{padding-top:0}
.
Uses the is-multiline
class to allow multiple lines of fields that wrap to the next line, when necessary.
The is-mobile
class allows multiple fields even when on mobile - remove this if you want fields to stack under each other on a mobile.
EDIT... For Bulma 0.9.0+
Bulma now has spacing helpers, so it can be now done without any custom css: replace the small-padding
custom class with bulma's new pt-0
spacing helper. So it is as simple as:
<fieldset>
<div class="columns is-mobile is-multiline">
<div class="column is-half pt-0"><input name="fname" class="input" placeholder="First Name..." required></div>
<div class="column is-half pt-0"><input name="lname" class="input" placeholder="Last Name..." required></div>
<div class="column is-full pt-0"><input name="email" type="email" class="input" placeholder="Email Address..." required></div>
<div class="column is-full pt-0"><label>Address</label><input name="address" class="input" placeholder="Full Address..."></div>
<div class="column is-full pt-0"><input name="city" class="input" placeholder="Suburb..."></div>
<div class="column is-half pt-0"><input name="state" class="input" placeholder="State..."></div>
<div class="column is-half pt-0"><input name="postal_code" class="input" placeholder="Postcode..."></div>
</div>
</fieldset>
Notes
- Use the
pd-0
class to help with spacing.
is-flex-tablet
as an additional class to wherefield-group
is, but I still need all the additional CSS to make sure the labels are spaced properly and take up the full row. Theis-horizontal
modifier is a good idea as well but it means you have to put your labels to the outside (which I don't want) and also (I believe) that you can only have one label per row (I need two, one for each field). – Halbeib