How to use HTML Entities In HTML
In this approach, we are using HTML entities to add symbols in HTML. Each entity begins with an ampersand (&) and ends with a semicolon (;), representing reserved characters such as ampersand (&), less than (<), greater than (>), copyright (©), and euro (€). These entities make proper rendering of symbols in web browsers, allowing us to display special characters accurately within HTML documents.
Example: The below example uses HTML entities to Add Symbols in HTML.
<!DOCTYPE html>
<head>
<title>Example 1</title>
<style>
h1 {
color: green;
}
</style>
</head>
<body>
<h1>w3wiki</h1>
<h3>Approach 1: Using HTML Entities</h3>
<p>Here are some symbols:</p>
<ul>
<li>& for & (ampersand)</li>
<li>< for < (less than)</li>
<li>> for > (greater than)</li>
<li>© for © (copyright)</li>
<li>€ for € (euro)</li>
</ul>
</body>
</html>
Output:
How to Add Symbols in HTML?
Symbols in HTML are important for conveying special characters, such as copyright, currency symbols, and arrows, which enhance content clarity and visual appeal. In this article, we will explore two different approaches to adding symbols in HTML.
Below are the possible approaches:
Table of Content
- Using HTML Entities
- Using CSS Content Property