I am using the bootstrap modal to show images and I would like that the width of this modal to be the same as the image inside.
Here is the Plunker of what I have tried so far. Without any extra css the width of the modal-dialog
is constant and equal to 600px and if we put width:auto
it just extends the width of the modal to the maximum (that's why I have put max-width:90%
)
Any idea to do so?
(The object tag is fine I need to use it for others reasons)
Thanks!
By default Block elements will expand to the width of their parent, setting to display:inline-block will default the width to a child element with layout
.modal-dialog{text-align:center;}
.modal-content{display:inline-block;}
http://plnkr.co/edit/QF2jp2KJKgAyNEz8tHQA?p=preview
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With