How to resize Twitter Bootstrap modal dynamically based on the content with CSS?

Spread the love

Sometimes, we want to resize Twitter Bootstrap modal dynamically based on the content with CSS.

In this article, we’ll look at how to resize Twitter Bootstrap modal dynamically based on the content with CSS.

How to resize Twitter Bootstrap modal dynamically based on the content with CSS?

To resize Twitter Bootstrap modal dynamically based on the content with CSS, we set the max height.

For instance, we write

.modal-body {
  position: relative;
  overflow-y: auto;
  max-height: 400px;
  padding: 15px;
}

to set the max-height ofi the modal body to make it expand to 400px as the max height.

Conclusion

To resize Twitter Bootstrap modal dynamically based on the content with CSS, we set the max height.

Leave a Reply

Your email address will not be published. Required fields are marked *