html - How can I use a `comment` fa-icon and a text div to display the number of messages a user has? -
i create message-counter similar link , using css , html.
let's assume have means of injecting number of messages using angularjs, , use code: <i class="fa fa-comment-o"></i>
present message icon. how can overlay span , put span element precisely in corner?
you can use below. it's span (positioned relative), contains icon , span positioned absolute.
<span class="count-icon"> <i class="fa fa-2x fa-comment"></i> <span class="count">3</span> </span>
and css:
.count-icon { display: inline-block; position: relative; } .count { position: absolute; top: 0; right: 0; height: 16px; width: 16px; background: red; border-radius: 8px; font-size: 12px; text-align: center; }
see fiddle: http://jsfiddle.net/mx45f/
Comments
Post a Comment