How do I hide this from Mobile?

HTML, CSS and anything else that deals with client side capabilities.

Moderator: General Moderators

Post Reply
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

How do I hide this from Mobile?

Post by simonmlewis »

Code: Select all

<div class='home-column mobile'>
<div class='home-column-inner'>
<div class='home-column-image'><img src='/images/head-contact.jpg' alt='contact '/></div></div>
</div>
So this DIV needs to show on all PCs and tablets.
But on mobile, I want it to disappear.

I thought if I added the " mobile", and then in the CSS for mobile widths, I added:

Code: Select all

<style>
.home-column mobile
{
display: none;
}
</style>
It would do it. But it doesn't.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: How do I hide this from Mobile?

Post by Celauran »

Set a display none in your media query?
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: How do I hide this from Mobile?

Post by simonmlewis »

Is that not what I have done in my CSS? It's not picking it up. I Assume I have done it right then?
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: How do I hide this from Mobile?

Post by Celauran »

You need to replace that space with a dot. I had missed that. You're targeting an element that has both classes. The way you have it written would hide a mobile element that is a child of an element of class home-column

Code: Select all

.home-column.mobile {
  display: none;
}
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: How do I hide this from Mobile?

Post by simonmlewis »

Now I've learnt something! Thanks. :)
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
Post Reply