3
I need to delete everything from body
, except for 2 items.
I tried the ways below but none worked:
body > *:not("div#pedidosRelMensal, h1.resposta"){
display: none;
}
body > *:not("div#pedidosRelMensal")not("h1.resposta"){
display: none;
}
body > *:not(#pedidosRelMensal, h1.resposta){
display: none;
}
If that’s all I do:
body > *:not(#pedidosRelMensal){
display: none;
}
Cool.
But I also need h1
.
You bore, I was already answering.
– Woss
kkkk, reponde ae tb @Andersoncarloswoss
– Carlos Rocha
@Andersoncarloswoss but I missed! : / I’ll even edit...
– hugocsl
In CSS I wouldn’t know how to do it, but in JS I would do it like this:
let printContents = document.getElementById('print').innerHTML;
 document.body.innerHTML = printContents;
– Edward Ramos
@Andersoncarloswoss now yes, concatenating the
:not():not()
One does not cancel the other. But collaborate there, the more better :d– hugocsl
But I can only do it by taking one element
– Edward Ramos
@Edwardramos com JS deve dar para fazer tranquilamente tb, the problem is that the JS bar the page print, the CSS no, so in theory for this case the CSS will be faster than the JS. With JS depending vc might even see the elements on the screen for a fraction of a second, before they disappear
– hugocsl
foma 1 solved for me, Thank you!
– Carlos Rocha
@Carlosrocha cool that solved there! Good luck on the project!
– hugocsl
Thanks, it’s ready now. That’s all we needed! But it will only be on localhost! Could have done it in Visuastudio or Delphi., but for this client I preferred in PHP even! Thanks for the help!
– Carlos Rocha