Skip to content

bootstrap-flex "mobile first"/xs columns aren't working unless explicitly declared #18237

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mejobloggs opened this issue Nov 13, 2015 · 1 comment
Labels

Comments

@mejobloggs
Copy link

This code works great on normal bootstrap 4 (and 3)

<style type="text/css">
    .col-sm-4 { border: 1px solid black; }
</style>

<div class="row">
    <div class="col-sm-4">aaa aaa aaa</div>
    <div class="col-sm-4">bbb bbb bbb bbb bbb bbb</div>
    <div class="col-sm-4">ccc ccc ccc ccc ccc ccc ccc ccc ccc</div>
</div>

As expected, you have 3 equal columns until you get down to XS, then you have 3, 100% vertically stacked columns like this:
XS screen without Flex
nonflex-working

However, when you enable Flex support, SM and up is still fine, but XS is not. This is what you get:

XS screen with Flex
flex-notworking1

Or... if there's enough room to fit more on a line, you will get this:
flex-notworking2

To get the desired column behavior with Flex I have to explicitly declare the XS columns like so:

<div class="row">
    <div class="col-xs-12 col-sm-4">aaa aaa aaa</div>
    <div class="col-xs-12 col-sm-4">bbb bbb bbb bbb bbb bbb</div>
    <div class="col-xs-12 col-sm-4">ccc ccc ccc ccc ccc ccc ccc ccc ccc</div>
</div>

Which in XS screen gives us:
flex-workingwithexplicitxs

Can we get it fixed so we don't have to explicitly declare col-xs-12?

@cvrebert
Copy link
Collaborator

Duplicate of #17603. Please search more in the future. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants