- This topic is empty.
-
AuthorPosts
-
July 14, 2013 at 7:19 am #46397bbilanderParticipant
Hi,
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 #142749Paulie_DMemberFor one thing your inputs are to wide…
input {
width: 470px;
}…is not overridden for checkboxes
July 14, 2013 at 10:08 am #142750Paulie_DMemberFor another you might try switching the order of the input and label in the HTML
July 14, 2013 at 10:09 am #142751georgearnallParticipantSomething like [this](http://cdpn.io/bHwKF “http://cdpn.io/bHwKF”) ?
July 14, 2013 at 10:12 am #142752Paulie_DMemberNo…I meant like this
July 14, 2013 at 10:26 am #142753georgearnallParticipant@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 #142820bbilanderParticipantHi georgearnall,
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 #142927Paulie_DMemberPerhaps 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 #142935Paulie_DMemberHacky 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 #142938georgearnallParticipant@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 #142939Paulie_DMemberSlighty 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 #142959bbilanderParticipantThanks 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.
CHeers! -
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.