-3

I use React and Bootstrap 4. How do I hide the element in the mobile version?

<Container fluid>
    <Row>
        <Col sm={12} md={3} hidden-xs-down>
    </Row>
</Container>

does not work.

Peter Mortensen
  • 30,030
  • 21
  • 100
  • 124

2 Answers2

1

In your JavaScript/jQuery code, add a line as follows:

if ($(window).width() < 768) {  
    $(.your-class-name).hide();
}

768 is for all devices, and if you need to add for a certain device (iPhone), use device width.

Peter Mortensen
  • 30,030
  • 21
  • 100
  • 124
Vishwa
  • 791
  • 9
  • 26
0

You mean Bootstrap 4, not 5. Use Responsive utilities.

Peter Mortensen
  • 30,030
  • 21
  • 100
  • 124