- This topic is empty.
July 14, 2013 at 7:19 am #46397
I’m having some difficulty creating a 3-column checkbox questionnaire thing at the top of my contact form. I’ve wrapped each label/checkbox with a div and tried to use floats to space them evenly across the form but the text keeps dropping down to the next line. [Here’s a link to the problem](http://cdpn.io/vsLng “codepen”). Any help people? Also, not quite sure how to fix the vertical alignment of the left-aligned text with the white input space. Love your thoughts!
Thanks in advance.
BJuly 14, 2013 at 10:02 am #142749
For one thing your inputs are to wide…
…is not overridden for checkboxesJuly 14, 2013 at 10:08 am #142750
For another you might try switching the order of the input and label in the HTMLJuly 14, 2013 at 10:09 am #142751
Something like [this](http://cdpn.io/bHwKF “http://cdpn.io/bHwKF”) ?July 14, 2013 at 10:12 am #142752
No…I meant like this
July 14, 2013 at 10:26 am #142753
@Paulie_D No, I mean’t I had a solution. I tested your solution and it doesn’t seem to work ? (including the input width)
For my solution, I used `inline-block` instead of floats. Instead of sifting through the code I just put in the necessary resets of rules.July 14, 2013 at 6:48 pm #142820
Thanks for your posts. I also thought to use inline-block but then the alignment goes awry. What I want is for the three checkboxes to be spread _evenly_ across the page. So that the first checkbox (and label) are left aligned, the second is dead center and the third is hard right. Visually that seems to be the best layout. If I float three divs with text I can get them to look exactly right, but when I wrap the label/checkbox combo the two don’t fit on the same line.. Any more suggestions? what am I doing wrong?July 15, 2013 at 5:56 am #142927
Perhaps you could show us how these checkboxes and labels are **supposed** to look in an image instead of us guessing from a description.
It would be very helpful.July 15, 2013 at 6:42 am #142935
Hacky but at least I have the boxes in the right place : http://codepen.io/Paulie-D/pen/HDEJw
Not sure how you can have a checkbox in the **exact** center or the page **and** a label without it looking pretty lop-sided.July 15, 2013 at 6:52 am #142938
@bbilander So you mean like [this](http://cdpn.io/HFuCb “http://cdpn.io/HFuCb”) ?
I think this is as simple as you could make it.July 15, 2013 at 6:54 am #142939
Slighty better. http://codepen.io/Paulie-D/pen/axhsm
The top one uses inline-block but requires a change in the source order for checkbox-3
The bottom one is in the correct source order but the floats mean that some tweaks would have to be made in the positioning.July 15, 2013 at 8:42 am #142959
Thanks Pauli_D and georgearnall for helping out. The checkboxes need to stay left of the label so the inline-block solution that georgearnall has suggested looks perfect. I’ll give it a go in my design shortly and let you know how it goes.
- The forum ‘CSS’ is closed to new topics and replies.