Skip to content
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

.card-img bug: cannot align two column with image #204

Open
zhengchun opened this issue Sep 22, 2018 · 1 comment
Open

.card-img bug: cannot align two column with image #204

zhengchun opened this issue Sep 22, 2018 · 1 comment

Comments

@zhengchun
Copy link

<div class="row no-gutters">
        <div class="col-12 col-md-5 d-flex">
            <a class="d-block overflow-hide" href="/">
                <div class="card">
                    <img  class="card-img img-fluid" src="/ImaginePeace_17124094261168052937_900x540.jpg">
                </div>
            </a>
        </div>
        <div class="col-12 col-md-7 d-flex">
            <div class="row no-gutters">
                <div class="col-6 col-md-4">
                    <a href="/" class="d-flex h-100">
                        <div class="card">
                            <img class="img-fluid card-img h-100" src="/BlackpoolTowerBallroom_714719417607972198_400x240.jpg">
                        </div>
                    </a>
                </div>
                <div class="col-6 col-md-4">
                    <a href="/" class="d-flex h-100">
                        <div class="card">
                            <img class="img-fluid card-img h-100" src="/DriftwoodPirate_15993172467744950522_400x240.jpg">
                        </div>
                    </a>
                </div>
                <div class="col-6 col-md-4">
                    <a href="/" class="d-flex h-100">
                        <div class="card">
                            <img  class="img-fluid card-img h-100" src="/CalidrisCanutus_10022354362427632830_400x240.jpg">
                        </div>
                    </a>
                </div>
                <div class="col-6 col-md-4">
                    <a href="/"  class="d-flex h-100">
                        <div class="card">
                            <img  class="img-fluid card-img h-100" src="/ViewofLiberty_3683339547473353821_400x240.jpg">
                        </div>
                    </a>
                </div>
                <div class="col-6 col-md-4">
                    <a href="/" class="d-flex h-100">
                        <div class="card">
                            <img  class="img-fluid card-img h-100" src="/MonumentFountain_4961822624051255351_400x240.jpg">
                        </div>
                    </a>
                </div>
                <div class="col-6 col-md-4">
                    <a href="/"  class="d-flex h-100">
                        <div class="card">
                            <img  class="img-fluid card-img h-100" src="/Plexus_6357385199072384560_400x240.jpg">
                        </div>
                    </a>
                </div>
            </div>
        </div>
    </div>

Expect Result

1

But Current Result

2

Solution

to fix just add width:100% to .card-img .

https://github.com/twbs/bootstrap/blob/v4-dev/scss/_card.scss#L123

.card-img {
width:100%;
}
@sesemaya sesemaya changed the title .card-img bug,cannot align two column with image .card-img bug: cannot align two column with image Jan 8, 2020
@sesemaya sesemaya added the bug label Jan 8, 2020
@sesemaya sesemaya added this to the Backfilling Bootstrap v4.4.1 milestone Jan 8, 2020
@devwork260802
Copy link

fix issue #204 by just add h-100 in a class="d-block overflow-hide" href="/"> in first Image div

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

3 participants