Developers

Conditional Content: How to Add Elements to Certain Devices

Conditional Content: How to Add Elements to Certain Devices

Want to have a specific element show up only for desktop users, and not users on tablets or mobile devices? Perhaps for a specific ad code or custom HTML setup that's only meant for one device.

We have the right tool to facilitate this sort of control over your site, and it's called the Conditional Content element.

By inserting an element you want specific control over inside of the Conditional Content element, you can create different experiences for mobile, tablet, and desktop users.

You can add the Conditional Content element to any part of your layout with the + ADD ELEMENT action in the Layout & Design tool.


Once the Conditional Content element is inserted, you can place new elements inside of it, such as Header Code.

In the drop-down menu of the Properties card, you can choose if you want the conditional content to be shown in mobile, tablet, or desktop views.

If you choose "Tablet" and you're in desktop view, or "Mobile" and you're in tablet view, and so on, don't worry — the element hasn't disappeared. It's only visible in the viewport when it's called to be displayed.

Bear in mind that if you want an element to display on desktop and tablet, for example, you'll have to create two different Conditional Content elements with the same element inside of each.

On Desktop

On Tablet

On Mobile

What Is RebelMouse?
Request a Proposal

Where 
Websites Are Built

The Fastest Sites in the World Run on RebelMouse

Let’s Chat

new!

RebelMouse Performance Monitoring

Real-Time Core Web Vitals

Get Started
DISCOVER MORE

Our Core Features

Our platform is a complete digital publishing toolbox that's built for modern-day content creators, and includes game-changing features such as our:

animate
Layout and Design toolLayout and Design tool on mobile
animate

Why RebelMouse?

Unprecedented Scale

RebelMouse sites reach more than 120M people a month, with an always-modern solution that combines cutting-edge technology with decades of media savvy. And due to our massive scale, 1 in 3 Americans have visited a website powered by RebelMouse.

120M+ Users
550M+ Pageviews
17+ Avg. Minutes per User
6+ Avg. Pages per User

Today's Top Websites Use RebelMouse

Thanks to the tremendous scale of our network, we are able to analyze a wealth of traffic data that informs our strategies and allows us to be a true strategic partner instead of just a vendor.

upworthyindy100Vault12No Film SchoolRawStoryResponsible StatecraftPrideRolling Stone QuebecPremierGuitarPenskeINN Educate Brand ConnectThe FulcrumGZEROOkayafricaBrit+CoPaper MagazinePowerToFlyNarcityCommonDreamsAllBusiness

What Clients Say

We’re here to help you weigh and understand every tech and strategic decision that affects your digital presence. Spend less time managing everything yourself, and more time focused on creating the quality content your users deserve.

Case Studies

A Team (and an Agency) Built Like No Other

RebelMouse employs a unique, diverse, and decentralized team that consists of 70+ digital traffic experts across more than 25 different countries. We have no central office, and we cover every time zone to ensure that we’re able to deliver amazing results and enterprise-grade support around the clock.

Our team is well-versed in all things product, content, traffic, and revenue, and we strategically deploy ourselves to help with each element across all of our clients. We thrive on solving the complex.

Let's Chat