Paradox Paradox - 24 days ago 7
HTML Question

How to select two elements with "> span" in CSS?

In my html code, I have the following two div elements:

<div id="graph-sliders">
...
</div>

<div id="image-sliders">
...
</div>


And in my corresponding css code, I have the follwing (working) code to style "graph-sliders":

#graph-sliders > span {
...
}


However, what I am trying to do is have that css block style both
graph-sliders
and
image-sliders
. I have tried writing
#graph-slider #image-sliders > span {
but it messes up the formatting when I view the webpage.

What is the correct way to style both
image-sliders
and
graph-sliders
with the
> span
?

Answer

Try the following:

#graph-sliders > span, #image-sliders > span {
  ...
}