Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Display: none ads in @media print

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #269272
    analis
    Participant

    hi, I have to hide the advertisement when the page is printed.

    This is my code but I can not hide the advertisement.

    Can you help me? thanks

    aaa is the name of the banner : ins class=”adsbygoogle aaa”

    .aaa { width: 468px; height: 60px; }
    @media (max-width: 345px) { .aaa { width: 300px; height: 250px; } }
    @media print {.aaa {display:none;}}

    #269340
    analis
    Participant

    @media screen {.aaa { width: 468px; height: 60px; }}
    @media print {.aaa { display:none; }}

    @media print dont’t work.

    #269341
    Beverleyh
    Participant

    Yes it does… in circumstances with clearly separate markup and styling… but you aren’t providing us with all the information.

    What is the full HTML markup?

    I suspect there are inline styles for the display property that are taking precedence, so I think you should research “how to override inline styles”, or “how to increase specificity in CSS”, or failing that, provide us with the actual markup so we don’t have to guess.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.