I want to set an attribute to two links with different IDs. Links are contained in a div with ID UserDiv. Something like this:
div#UserDiv (a#login_link, a#register_link){
float:right;
}
But this obviously doesn’t work. Is it even possible?
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.
That syntax is not legal, but you can do it. In general, you need to repeat the
div#UserDivpart:In this specific case you might be able to just remove the div selector entirely since the ids of the anchors are enough to uniquely identify them. Of course this depends on you not using these same ids in a different part of the DOM under different circumstances, which is IMHO a good idea to do.