I’m using this CSS
.options input[type="radio"],input[type="checkbox"],label{
vertical-align: middle;
}
But the vertical-align property is being assigned to all the check boxes on the site not just ones in the ‘options’ class.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
CSS rules which are comma seperated, have no relation to each other, and are just a short-hand, consistent way, of applying the same styles for different rules. Your example could be rewritten as:
Therefore the 2nd & 3rd rule will apply these styles to all input checkboxes and labels. To get the results you are after, your rules should be rewritten as:
Then the shorthand for this would be:
Also, its worth noting, that best practice is to put each rule & style on a seperate line. This will make version controlling a lot easier if you are to later use it.