Despite researching many topics, I am still unable to get this to work.
My goal is to hide certain elements on my webpage when the user tries to print it.
I am currently using Bootstrap 5, which includes the following CSS:
@media print{.d-print-none{display:none!important}}
To implement this, I simply added it to the HTML like this, for example:
<div class="d-print-none">Some text</div>
However, when I press CTRL+P, all the text still shows up for printing.
I also attempted to create my own CSS:
@media print{
.noprint{
display: none !important;;
}
}
Unfortunately, the elements are still not hiding when I try to print them. Any suggestions?