Namo
Namo

Reputation: 17

Div auto height not working

Visit (small browser width) website ==> Roll Number ==> type jit, there will be scrollbar at that div. (Done)

Now visit (small browser width) website ==> Audio Tutorials ==> click part1, the div height will increase. (Good)

My question is why the Roll Number div does not increase the height?

Code:

@media screen and (max-width: 650px) {
    .card.h-50 {
        height: auto !important;
    }
}

Upvotes: 0

Views: 3473

Answers (1)

brian17han
brian17han

Reputation: 1279

The problem is your search-box div has a fixed height and your result div has position: absolute; which prevents your card div to grow.

Absolutely positioned elements are not counted as part of document flow, so their width and height won't affect the dimensions of their parents.

Simply change the position: absolute; to position:relative; will fix your problem.

The problematic div.

Upvotes: 1

Related Questions