• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 503
  • Last Modified:

Checkbox layout in CSS

I'm trying to use checkboxes in a form layout using css. Does anyone have the css code and html for a css layout using checkboxes. My checkboxes are not lining up with the labels, and when I click on the labels it does not check the checkbox... even if I wrap the input tag with lable tag etc.
  • 2
1 Solution
Tony van SchaikFront-end Web developerCommented:
If you want to align the labeltext vertical use style="vertical-align:middle;width:32;height:32;"
More info here:
Clicking on a label does not toggle the check box - that is by design: Clicking the label shall only *focus* an input element.
jasch2244Author Commented:
It appears that if you use a for in the lable tag or wrap the input tag with the lable tags that infact you can select / toggle the check box
jasch2244Author Commented:
vertical-align on the input / checkbox seemed to fix the problem.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now