Archive for the ‘CSS’ Category

It is some time very tidious to align the radio buttons and corresponding labels with each other.

Here is the trick to do that. Say you have a wrapper div in which you have radio buttons and labels and id of the wrapper div is radioButtonsWrapper then add the following into your style sheet


.radioButtonsWrapper label
{
float:left;
margin-top:2px;
}

.radioButtonsWrapper input[type='radio']
{
float:left;
}

and for checkboxes


.radioButtonsWrapper label
{
float:left;
margin-top:2px;
}

.radioButtonsWrapper input[type='checkbox']
{
float:left;
}