1

I have a problem trying to make a webpage with bootstrap 4 and flex. I am using Bootstrap cards with certain width. I see that this works fine in Google Chrome and Opera but appears to not work in Firefox. Here is my code:

    <div class="row auxAltura2">
    <div class="col">
        <div class="card">
            <div class="card-header colorPlataforma">
                Tags
            </div>
            <div id="moduloTags" class="card-body">
                ...

            </div>

        </div>
    </div>
    </div>

And now here is my css:

   .auxAltura2{height:250px}
    .card-header{
        display: flex;
        flex: 1 0 30px;
        align-items: center;
        font-size:17px;
    }

Image card on firefox:

enter image description here

And this is image from card on Opera:

enter image description here

You can see the difference between the 2 browsers. Is a bug? Glad if you can help me. Thanks for all.

Roberto García
  • 115
  • 1
  • 11

1 Answers1

2

Problem is padding on flex element, which is added extra to your 30px .card-header height.

You should set the top and bottom padding of .card-header to 0;

See this SO question for more details: How to get flexbox to include padding in calculations?

James Wrcsti
  • 220
  • 1
  • 8