Html Entity for Check Mark
To display a simple or bold check mark in HTML, use the entities ✓
(✓) or ✔
(✔) respectively. Plug them right inside your HTML code to represent these symbols.
Example:
Alternatives: The art of the image
While HTML entities are your go-to for simplicity, there are moments when they aren't the perfect fit. For instances where compatibility is at stake with older browsers, you might consider using an image as your check mark. Here, we guarantee the symbol rendition is consistent:
Ensure you have permissions for the image, and an alt
attribute is a must (screen readers love them).
Hex and Decimal Notations
Each HTML entity check mark comes with both a hexadecimal (hex) and decimal notation.
- Hexadecimal:
✓
(✓) or✔
(✔) - Decimal:
✓
(✓) or✔
(✔)
Hex might be considered a tad more readable as it matches the Unicode standard, but both play nice with HTML. Choose whatever suits your style.
Fallbacks: Dealing with older browsers
When dealing with legacy browsers, compatibility is not just a key, it's the whole damn locksmith. Always take the time to test your pages across different environments. If your symbol doesn't render as expected, consider images or even CSS as a fallback to render the check mark:
This little piece of code cleverly injects the check mark symbol before any element with the check
class. Magic!
Unicode: The character master
To ensure your check marks and other characters are showing up right, always save your HTML as Unicode (UTF-8 or UTF-16). This helps prevent those "Monday morning" characters.
Moreover, resources like AmpWhat or Wikipedia's list are great for discovering new character possibilities for not just check marks but for all characters.
Styling: Dress up your check mark
Being able to customize is the icing on the cake. Use CSS for styling HTML entities, giving your check marks a wardrobe:
Dynamic Insertion: JavaScript to the rescue
Perhaps you prefer a more dynamic method? With JavaScript, you can add check marks into the DOM:
Here's an interactive, on-the-fly method when an HTML entity isn't enough.
Was this article helpful?