1

I am trying to have 12 columns, which would take up 1 column each on a large screen, and 4 columns each on a small screen. But when I try to minimize it, nothing happens, they just get pushed one underneath another. I wanted to have 3 columns in one row on small screens, but that doesn't happen and I am wondering what I am doing wrong here. Can you please help me out without adding negative reputation to the post? Thank you!

Here's the code:

<div class="container">
  <div class="row">
    <div class="col-lg-1 col-xs-4 bg-warning">Warning</div>
    <div class="col-lg-1 col-xs-4 bg-info">Info</div>
    <div class="col-lg-1 col-xs-4 bg-danger">Cancel</div>
    <div class="col-lg-1 col-xs-4 bg-success">Yes</div>
    <div class="col-lg-1 col-xs-4 bg-warning">Warning</div>
    <div class="col-lg-1 col-xs-4 bg-info">Info</div>
    <div class="col-lg-1 col-xs-4 bg-danger">Cancel</div>
    <div class="col-lg-1 col-xs-4 bg-success">Yes</div>
    <div class="col-lg-1 col-xs-4 bg-warning">Warning</div>
    <div class="col-lg-1 col-xs-4 bg-info">Info</div>
    <div class="col-lg-1 col-xs-4 bg-danger">Cancel</div>
    <div class="col-lg-1 col-xs-4 bg-success">Yes</div>
  </div>
</div>

2 Answers 2

3

col-xs is not available in bootstrap 4.

For "xs" you have to use "col" only. Like: col-4;

To learn more take a look at bootstraps documentation.

Sign up to request clarification or add additional context in comments.

Comments

1

As far as i know there is no "col-xs-" in bootstrap 4. so use "col-" for small screen

.col-sm for larger mobile phones (devices with resolutions ≥ 576px);
.col-md for tablets (≥768px);
.col-lg for laptops (≥992px);
.col-xl for desktops (≥1200px)

1 Comment

yes exactly, but this was my way of finding that out:)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.