overlap notification badge on glyph in Bootstrap 3

后端 未结 3 1329
耶瑟儿~
耶瑟儿~ 2021-01-30 03:27

I\'m trying to create a comment/notification setup in bootstrap, and can\'t seem to get the alignment right.

I\'m going for a pretty common layout as in this screenshot:

3条回答
  •  被撕碎了的回忆
    2021-01-30 03:57

    For dynamism, I'd like to mention the usage of transform instead of relying on trial/error of pixels (which might still be of your use, depending on the use case)

    3
    .badge-notify{ background:red; position:relative; transform: (-100%, -100%); }

    This will position the badge just touching to the button. Depending on how much overlapping you want, decrease the x value. eg., for half of the badge - transform: (-150%, -100%) would be ideal.

提交回复
热议问题