0

I have a web page, for example one showing a Google Analytics report. One of the graphs is in a div with id = "ID-overview-graph". How can I use css to show only it in the page?

I've tried:

body {
  display: none
}

#ID-overview-graph {
  display: block
}

which didn't work for obvious reasons.

Juanjo Conti
  • 28,823
  • 42
  • 111
  • 133

1 Answers1

0

Assuming all other elements on the page are div elements, you could do:

div:not(#ID-overview-graph) {
    display: none;
}

This way, you're not using such an expensive selector as the wildcard selector *

If you have other elements, you could list them all out with that :not() statement.

If you can include the rest of your html, that would be helpful.

Alex Wright
  • 456
  • 2
  • 5