【问题标题】:How to hide the element in the mobile version手机版如何隐藏元素
【发布时间】:2018-04-18 13:29:51
【问题描述】:

我使用 React 和 Bootstrap 4。如何在移动版本中隐藏元素?

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

不起作用。

【问题讨论】:

标签: twitter-bootstrap reactjs reactstrap


【解决方案1】:

在您的 JavaScript/jQuery 代码中,添加如下一行:

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

768适用于所有设备,如果需要为特定设备(iPhone)添加,请使用设备宽度

【讨论】:

    【解决方案2】:

    您的意思是 Bootstrap 4,而不是 5。使用 Responsive utilities

    【讨论】:

    • 不起作用
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-11-08
    • 2016-06-19
    • 1970-01-01
    • 2021-10-08
    • 1970-01-01
    • 1970-01-01
    • 2011-02-13
    相关资源
    最近更新 更多