8
Maybe these questions can be labeled "idiot", but believe me, I really need to ask this here because I have not found anywhere on the Internet and who can help me I will be very grateful...
Is there any way to do 2 (two) or more "@media print" of css? For example, I made one to print a certain div, now I want to print another totally different div with other formatting settings, as I would using @media print itself?
Taking advantage of the question, there is some way to format the div as desired before having printed by javascript, I did not like the javascript printing, comes almost nothing of what was done on the page other than pure writing. '-'
@media print {
body * {
visibility: hidden;
}
.noneImprime
{
display: none;
}
#imprime, #imprime * {
visibility: visible;
margin-top: -160px !important;
}
#imprime
{
width: 1100px;
}
.btn-resultado{
display: none;
}
@page{
size: landscape;
}
}
Above is the code I am using to print my div with the ID: print, however I have another div, which in my case is the content of a modal to print, how do I print only the desired content as it correctly shows above and in the same print print print only the content of my modal? In this case every time I click on the designated button it will always print the same div.
I understood Vinicius, thank you very much for the answer, however I have one more question, in my case I use the visibility: Hidden and Visible to show in the print sheet only the desired content, to do this with two different Ivs I think it does not right, why either show one or show the other.
– Lincoln Binda
Dude, if you can edit your question with the code that makes it easier to understand that, but then it’s a matter of assigning an id or a different class and working with the CSS rules.
– Kiss
I edited the post, I don’t think I know how to explain right, anyway I really appreciate your help.
– Lincoln Binda
Hm, the explanation is a little complicated to understand to be honest, I don’t know if HTML would help, but it wouldn’t just be a matter of forcing a display on the content of the modal?
– Kiss
No, but your answer is correct, thank you for your help, thank you very much.
– Lincoln Binda