Solved

Checkbox layout in CSS

Posted on 2009-05-07
4
480 Views
Last Modified: 2012-05-06
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.
0
Comment
Question by:jasch2244
  • 2
4 Comments
 
LVL 12

Accepted Solution

by:
Tony van Schaik earned 500 total points
ID: 24328921
If you want to align the labeltext vertical use style="vertical-align:middle;width:32;height:32;"
More info here:
http://stackoverflow.com/questions/306252/how-to-align-checkboxes-and-their-labels-consistently-cross-browsers
http://www.xinotes.org/notes/topic/437/
 
 
0
 
LVL 20

Expert Comment

by:thehagman
ID: 24329077
Clicking on a label does not toggle the check box - that is by design: Clicking the label shall only *focus* an input element.
0
 
LVL 1

Author Comment

by:jasch2244
ID: 24329119
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
0
 
LVL 1

Author Closing Comment

by:jasch2244
ID: 31579146
vertical-align on the input / checkbox seemed to fix the problem.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

CSS3 Custom checkboxes This article shows how to style the checkbox form element using only CSS. Works in: Chrome, FF, Safari, Opera, IE9+ Uses modernizr.js to check for :checked pseudo class, falling back to plain old checkboxes (IE8 and bel…
Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question