Changing the width of Bootstrap popover

后端 未结 23 1576
北恋
北恋 2020-11-27 10:51

I am designing a page using Bootstrap 3. I am trying to use a popover with placement: right on an input element. The new Bootstrap ensures that if you use

23条回答
  •  长情又很酷
    2020-11-27 11:26

    One tested solution for Bootstrap 4 beta:

    .popover {
            min-width: 30em !important;
        }
    

    Together with the jQuery statement:

    $('[data-toggle="popover"]').popover({
          container: 'body',
          trigger: 'focus',
          html: true,
          placement: 'top'
        })
    

    Side-note, data-container="body" or container: "body" in either HTML or as an option to the popover({}) object didn't really do the trick [maybe the do work but only together with the CSS statement];

    Also, remember that Bootstrap 4 beta relies on popper.js for its popover and tooltip positioning (prior to that it was tether.js)

提交回复
热议问题