Answers for "how to use unicodes in css"

CSS
1

how to use unicode in css

/*
Notes Before Start:
1_ unicode can be added only for css 'content' property.
2_ content property cannot be used without ::before and ::after pesudo classes.
3_ if you use content without applying step 2 nothing will be affected.
*/
.my-div{
  background-color: #f00;
  border: 2px solid #00f;
}
.my-div::after{
  content: "0a9"; /* Copyright Icon */
  font-size: 40px;
  color: #fff;
}
/*
You can use unicode inside your html by adding &
HTML copyright icon: <p>&copy;</p>
CSS copyright icon: example above
*/
Posted by: Guest on June-17-2021

Browse Popular Code Answers by Language