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?
That syntax is not legal, but you can do it. In general, you need to repeat the div#UserDiv part:
div#UserDiv a#login_link, div#UserDiv a#register_link
{
float:right;
}
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.