0

As mentionned, I would like to not have a property on a div on mobile device.

I have done that so far, which works with chrome but probably not with other browsers :

 <div collapse="true" class="visible-xs">
 <div class="hidden-xs">
    ...
 </div>

What's the correct way to do this ? Is there a way I can get away without using js ?

Thanks

Scipion
  • 10,555
  • 15
  • 66
  • 125
  • 2
    This code makes no sense. You're only showing the containing element on mobile, but then you're hiding the child element on mobile, so nothing will be visible at any size. – APAD1 Mar 23 '16 at 16:45
  • Please clarify the question – Zim Mar 23 '16 at 17:26
  • Please check this topic http://stackoverflow.com/questions/14207109/hiding-elements-in-responsive-layout – joint_ops Mar 23 '16 at 22:12

1 Answers1

1

When you say 'not have a property on a div', do you mean how to hide a div on a mobile device? If so the second div in the snippet should work cross-browser thanks to the class="hidden-xs".

The first div in the snippet will only be shown on devices with viewports which fall within the xs range (<768px based on an unmodified build of Bootstrap 3).

Using what you've written would show the user separate content based on the device's viewport size.