79088298

Date: 2024-10-15 03:20:08
Score: 1.5
Natty:
Report link

2024 answer here !

I tried all the options posted here, but I didn't succeed.

Here's my solution with javascript:

const myDiv = document.querySelector('.my-div');
const divHeight = myDiv.offsetHeight - 1;
myDiv.style.height = modalHeight + 'px';

I found that setting a height in CSS worked just fine but my case is to height always be set as "auto", so I use js to get the current height from my div and subtract by 1.

Worked like a charm!

Reasons:
  • Blacklisted phrase (1): Worked like a charm
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Lucas Santana