Answers for "How to use unicode in HTML 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: "\00a9"; /* 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
1

how to use unicode in html

<!DOCTYPE html>
<html>
<body>

<p>I will display &spades;</p>
<p>I will display &#9824;</p>
<p>I will display &#x2660;</p>

</body>
</html>
Posted by: Guest on March-01-2021

Browse Popular Code Answers by Language