Problem when reinstalling div in xs devices

enter image description here       Figure A shows my design for sm, md, and lg devices. For xs devices, block B should be displayed above block A (as shown in Figure B). But I don’t know what is wrong with code.Someone, please help me.

<!DOCTYPE html>
<html>
  <head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
  </head>
<body>
  <div class="container">
    <div class="row">
      <div class="col-xs-12 col-sm-3 col-md-2 col-lg-2 col-xs-push-12">A</div>
      <div class="col-xs-12 col-sm-6 col-md-8 col-lg-8 col-xs-pull-12">B</div>
    <div class="col-xs-12 col-sm-3 col-md-2 col-lg-2">C</div>
  </div>
</div>
</body>
</html>
+4
source share
1 answer

This is my first introduction to Bootstrap, but after a little research, I found the Bootstrap 3 page : Push / pull columns only on smaller screen sizes ( /questions/101278/bootstrap-3-pushpull-columns-only-on-smaller-screen-sizes), to be quite useful in relation to your problem.

I suggest you replace the strings for A, B and C with ...

      <div class="col-xs-12 col-sm-6 col-sm-push-3" style="background-color:lightcyan;">B</div>
      <div class="col-xs-12 col-sm-3 col-sm-pull-6" style="background-color:red;">A</div>
      <div class="col-xs-12 col-sm-3" style="background-color:yellow;">C</div>

Try-It-Yourself, http://www.w3schools.com/bootstrap/bootstrap_grid_examples.asp .

. Bootstrap . , xs- , , .

, sm-, , sm .

, . , .

+5

Source: https://habr.com/ru/post/1608651/


All Articles