imanebz
imanebz

Reputation: 79

How to make a div height responsive?

I'm working on a pricing table for my website and I'm having an issue. I'm trying to make the table responsive, but when I change the resolution, the height doesn't change so the text is not all visible anymore. Please find below a screenshot.

screenshot

Plus, I want the 3 blocks (columns) to have the same height even though the content is not the same.

Can anyone suggest a solution? Thanks!

Upvotes: 1

Views: 204

Answers (1)

Caglayan
Caglayan

Reputation: 46

You should add display: block; line in your divisions css code.

But if you want to change other 2 divisions height syncronisely, you have to use javascript. Like this:

$(document).ready(function(){
    var height = $("#myDiv").innerHeight();
    document.getElementById("myOtherDiv").style.height = height + "px";
});

Make sure to remove any fixed heights as well

Upvotes: 1

Related Questions