Changing the width of Bootstrap popover

后端 未结 23 1530
北恋
北恋 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:24

    No final solution here :/ Just some thoughts how to "cleanly" solve this problem...

    Updated version (jQuery 1.11 + Bootstrap 3.1.1 + class="col-xs-" instead of class="col-md-") of your original JSFiddle: http://jsfiddle.net/tkrotoff/N99h7/

    Now the same JSFiddle with your proposed solution: http://jsfiddle.net/tkrotoff/N99h7/8/
    It does not work: the popover is positioned relative to the

    + imagine you have multiple inputs for the same
    ...

    So if we want to keep the popover on the inputs (semantically better):

    • .popover { position: fixed; }: but then each time you scroll the page, the popover will not follow the scroll
    • .popover { width: 100%; }: not that good since you still depend on the parent width (i.e
    • .popover-content { white-space: nowrap; }: good only if the text inside the popover is shorter than max-width

    See http://jsfiddle.net/tkrotoff/N99h7/11/

    Maybe, using very recent browsers, the new CSS width values can solve the problem, I didn't try.

提交回复
热议问题