HTML इमोजी
In this page:
<meta charset="UTF-8">
&#emoji_number;
HTML में Emoji क्या है?
Emojis असल में universal Unicode standard के अंदर mapped text characters होते हैं। Browsers इन codes को पढ़ते हैं और अपने-आप उन्हें रंगीन icons के रूप में render करते हैं।
उदाहरण: What is an Emoji in HTML?
<p style="font-size: 48px;">😀</p>
Decimal Code Mappings इस्तेमाल करना
HTML में emojis लिखने का सबसे आम तरीका decimal codes है। हर emoji code एक ampersand और hash symbol (&#) से शुरू होकर एक semicolon (;) पर खत्म होता है।
उदाहरण: Using Decimal Code Mappings
<p>😀</p>
Hexadecimal Code Mappings इस्तेमाल करना
आप hexadecimal codes इस्तेमाल करके भी emojis लिख सकते हैं। Hexadecimal emoji codes एक ampersand, hash, और x character (&#x) से शुरू होकर एक semicolon (;) पर खत्म होते हैं।
उदाहरण: Using Hexadecimal Code Mappings
<p>😀</p>
Character Set Compatibility सुनिश्चित करना
अपने page पर emojis को सही तरीके से दिखाने के लिए, आपको अपने head tag के अंदर UTF-8 को अपने document के character set के रूप में declare करना होगा। अगर आप यह declaration छोड़ देते हैं, तो browser आपके emojis को टूटे-फूटे, गड़बड़ symbols के रूप में दिखा सकता है।
उदाहरण: Ensuring Character Set Compatibility
<head>
<meta charset="UTF-8">
</head>
<p>😀</p>
Screen Readers के लिए Accessible Emojis
Screen readers को emojis समझने में मुश्किल हो सकती है। दृष्टिबाधित users के लिए अपने emojis को accessible बनाने के लिए, अपने emojis को role="img" attribute और icon बताने वाले aria-label के साथ एक span tag में wrap करें।
उदाहरण: Accessible Emojis for Screen Readers
<span role="img" aria-label="Smiling face">😀</span>
- अपने emoji codes के अंत में ज़रूरी semicolon (;) शामिल करना भूल जाना।
- अपने head section में ज़रूरी UTF-8 charset declaration छोड़ देना, जिससे emojis टूटे हुए symbols की तरह दिखते हैं।
- descriptive accessibility labels जोड़ना भूल जाना, जिससे आपके emojis screen-reader users के लिए अनुपयोगी हो जाते हैं।
- Emojis असली text characters हैं जो universal Unicode standard के अंदर mapped होते हैं।
- अपने webpage पर simple decimal (&#) या hexadecimal (&#x) codes इस्तेमाल करके emojis दिखाएं।
- अपने document का character set UTF-8 declare करें और अपने emojis को सबके लिए accessible रखने के लिए descriptive accessibility labels इस्तेमाल करें।
standard Unicode emojis सभी modern web browsers में natively पूरी तरह supported हैं।
Chapter Quiz — Complete all 10 topics to unlock
0/10 topics done
Complete these topics first: