S
S
Sasha Brahms2015-10-29 02:34:58
css
Sasha Brahms, 2015-10-29 02:34:58

How to hide all elements except a certain one?

It is necessary to hide all blocks except for a certain one (to print the media print page)
I do:

*{
display:none;
}
#print{
display: block !important;
}

Nothing comes out, please help. I can't figure it out anymore.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Z
zooks, 2015-10-29
@zooks

Hide child body blocks by comma-separated listing instead of a general selector.

N
nirvimel, 2015-10-29
@nirvimel

*:not(#print) {
    display:none;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question