1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.5 Placing an image to ad_header that will only show on desktop and tablets

Discussion in 'XenForo Questions and Support' started by Ozan Çorumlu, Dec 23, 2015.

  1. Ozan Çorumlu

    Ozan Çorumlu New Member

    Hello everyone. I want to add an 728x90 ad code (not adsense, an image with link) to ad_header template.

    But I want it to be shown only on desktop and mobile. How can I do that? I dont have much coding experience.

    Afaik @Brogan 's responsive adsense code works for this but I dont know how to convert it to my purpose.

    Can anyone help me?

    @wang
    @Mike
    @Kier
     
  2. Ozan Çorumlu

    Ozan Çorumlu New Member

  3. Brogan

    Brogan XenForo Moderator Staff Member

  4. AndyB

    AndyB Well-Known Member

  5. Brogan

    Brogan XenForo Moderator Staff Member

    An add-on is not required when it can be achieved using a built in template (ad_header) specifically designed for that purpose.
     
    Amaury and Tracy Perry like this.
  6. Ozan Çorumlu

    Ozan Çorumlu New Member

    In this guide there is a CSS code that depends on browser width:
    HTML:
    <xen:if is="@enableResponsive">
        @media (max-width:800px) {
            .MyContent {
            color: red;
            }
        }
    
        @media (max-width:610px) {
            .MyContent {
            color: green;
            }
        }
    
        @media (max-width:480px) {
            .MyContent {
            color: blue;
            }
        }
    </xen:if>
    It's what I need, but I need it's HTML version because of I will be using img src code that depends on browser width.

    How can I achieve this?
     
  7. Brogan

    Brogan XenForo Moderator Staff Member

    I don't know what you mean by HTML version.

    Just edit the CSS to suit.
     

Share This Page