Header labels in CSS3
Hey buddies !
So, I had this h1, and I wanted to display "NEW" aside like this :
I found a simple way of proceeding without any image, pure CSS. Eventually, it was less complicated than I expected...
h1:after {
background: #116111;
border-radius: 2px;
color: #fefefe;
content: "NEW";
font-size: 8px;
margin-left: 5px;
padding: 0 3px;
vertical-align: super;
}
This is a "classic" CSS version, I did a simple mixin in SASS to make it even easier to use ;)
Written by Emmanuel Bourgerie
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Html
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#