Search
 
SCRIPT & CODE EXAMPLE
 

CSS

create notification badge in css

html file:

<div class="my-element" notif="77" ></div>



css file:

.my-element {
    position: relative;
    width: 50px;
    height: 50px;
    border: 1px solid black;
    border-radius: 4px;
}

.my-element::before {
    content: attr(notif);
    position: absolute;
    top: -0.75em;
    right: -0.75em;
    width: 1.5em;
    height: 1.5em;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background-color: red;
    color: white;
}
Comment

PREVIOUS NEXT
Code Example
Css :: set margin to none inside print 
Css :: centre align in position absolute 
Css :: css background linear gradient transparent 
Css :: line through text css 
Css :: what does clearfix for floats do in css 
Css :: css nth element 
Css :: print not showing background image 
Css :: boostrap line 
Css :: align div bottom of parent 
Css :: no scrollbar tailwind 
Css :: robot font import 
Css :: how to set div background image 
Css :: style highlight css 
Css :: disabled button tailwind css class on basis of true false 
Css :: css border shorthand 
Css :: css border width 
Css :: bootstrap card hover effect 
Css :: limit number of text lines 
Css :: css after 
Css :: css gradient 3 colors 
Css :: css conver innertext to html using css 
Css :: css variable 
Css :: add icon to input field 
Css :: bootstrap media query 
Css :: how to add css using nativeelement in angular 
Css :: transition timing functions 
Css :: flex align self 
Css :: Correct border property to add ROUNDED borders to the elements 
Css :: css border-left 
Css :: css background overlay 
ADD CONTENT
Topic
Content
Source link
Name
9+2 =