.box_content ::selection {
background:#CCCC33; /* Safari */
}
.box_content ::-moz-selection {
background:#CCCC33; /* Firefox */
}
Anyone know if I can combine those like this?
.box_content ::selection .box_content ::-moz-selection {
background:#CCCC33;
}
Or maybe like:
.box_content ::selection, .box_content ::-moz-selection {
background:#CCCC33;
}
The second one is correct. You can use a comma to separate css selection rules.
So given:
This will apply
style-x&style-yto anything that matches eitherselector-rule1orselector-rule2.Just to explain why your first example won’t work, its because
spacesimply ancestor-descendant relationships, so if you have:Then
style-zwill be applied to anything that matchesselector-rule4if it is also an an ancestor of something that matchesselector-rule3.More info on selectors here.