Dynamically add a class to Bootstrap's 'popover' container

后端 未结 22 2559
名媛妹妹
名媛妹妹 2020-11-29 18:27

I\'ve thoroughly searched through both StackOverflow and Google, but come up empty. So apologies in advance if this has been asked & resolved already.

NB

22条回答
  •  情话喂你
    2020-11-29 18:58

    I'm not sure why you want to do this, but in my example, I just wanted to set custom style... So in CSS just written right selector for current popover. a.rating-popover - this is my link for opening popover. -> the popover element will be generated to the next of that element. so we can select it with

    a.rating-popover + div.popover{
       background: blue;
    }
    

    and voila, blue background. for only popovers opened with a.rating-popover element.

提交回复
热议问题