1

I have a <div> like this:

<div class="embed-responsive embed-responsive-16by9">
       <iframe class="embed-responsive-item" src="slider.html"></iframe>
</div>

But when I decrease the screen size to small or medium, I will get white-space beneath the <div>.

Like This:

enter image description here

How can I have a dynamic height for this <div> to avoid the white-space?

shaun
  • 1,017
  • 11
  • 22
Kia Boluki
  • 315
  • 3
  • 15

2 Answers2

0

You need using javascript to discover the dynamic height.

We have some functions in this links: make iframe height dynamic based on content inside- JQUERY/Javascript

and call when the browser resize.

Community
  • 1
  • 1
0

use media query like and add it to custom css

this is just a sample

@media (min-width: 992px) and (max-width: 1199px) {
 .visible-md-block {
 display: block !important;
}
syedsafir
  • 72
  • 1
  • 9