Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
563 views
in Technique[技术] by (71.8m points)

reactjs - How to reverse columns in reactstrap?

I want to implement something like this

on Desktop : A B on Mobile : B A

I have tried using using react strap grid system but couldn't find a way to make it work Im using reactstrap library in nextjs ,


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Reactstrap also provides a bootstrap lib

which is imported in _app.js as so

import "../assets/css/bootstrap.min.css";

now as it also support the latest version of bootstrap , which is bootstrap 4

col-sm-push-4 , col-sm-pull-4 classes are deprecated and cannot be used.

Bootstrap 4 provides other flex classes to make it responsive

here's the solution

 <Container fluid>
        <Row className="flex-column-reverse flex-md-row">
        <Col className="col-md-8">
          <h1>AAAAA</h1>
       </Col>
       <Col className="col-md-4">
       <h1>BBBBB</h1>

       </Col>
        </Row>
</Container>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share
...