Showing posts with label एच टी एम एल सीखीये (हिन्दी में). Show all posts
Showing posts with label एच टी एम एल सीखीये (हिन्दी में). Show all posts

Friday, 28 March 2014

What is XHTML


जब W3C ने HTML का 4.1 Version Release किया, तब उन्होंने Document के Style से सम्बंधित सभी Markup को Deprecated Mark कर दिया यानी उन्होंने तय कर लिया कि HTML के Future Versions में इन HTML Markups को Remove कर दिया जाएगा। ऐसा उन्होंने इसलिए किया था, ताकि लोग Web Pages के Structure को Web Pages के Style से अलग Develop करें। परिणामस्वरूप आज के सभी नए Web Pages में केवल HTML Document का Structure होता है और HTML Web Page से सम्बंधित सभी Stylizing Markup एक अलग CSS File में होते हैं। हालांकि हम आज भी इन Style Markups को अपने HTML Document में HTML Structure के साथ उपयोग में ले सकते हैं, लेकिन हमें ऐसा करना नहीं चाहिए।
HTML के 4.1 Version को Release करने के बाद W3C ने HTML का 5.0 Version Release नहीं किया, बल्कि उन्होंने HTML को एक नए रूप में Release किया जिसका नाम उन्होंने XHTML रखा, ठीक उसी तरह से जिस तरह से Microsoft ने Window 2000 Release करने के बाद Windows 2001 Release नहीं किया बल्कि Windows XP Release किया था।
HTML के नाम के पहले X अक्षर को इसलिए लगाया गया, क्योंकि ये अक्षर एक नई Language XML (eXtensible Markup Language) से आया था। इस इस Language ने विभिन्न Programming क्षैत्रों में बहुत ही जल्दी बहुत ज्यादा प्रसिद्धि प्राप्त कर ली थी, क्योंकि इस Language का प्रयोग करके हम हमारी जरूरत के अनुसार अपने स्‍वयं के HTML Elements Create कर सकते हैं। इसीलिए W3C ने तय किया कि वह HTML के अगले Version को XML में लिखकर Release करेगा और उन्होंने ऐसा ही किया।
प्रायोगि‍क रूप से इसका मतलब ये हुआ कि जो लोग Web Pages लिखते हैं, उन लोगों को अब अपने HTML Codes को लिखने के बारे में ज्यादा सावधान रहना जरूरी है, क्योंकि XML एक Strict Language है, इसीलिए XHTML भी एक Strict Language बन गई है। Stricter Language का एक फायदा ये है कि Web Browser की Size छोटी हो गई है, जिससे Web Pages को अब ज्यादा छोटी Screen यानी Mobile जैसे Device पर भी आसानी से देखा जा सकता है। दूसरा फायदा ये है कि XML के लिए कई Tools को Develop किया गया है और हम उन सभी Tools को XHTML के साथ भी उपयोग में ले सकते हैं।
Web Programming सीखने वाले एक नए Developer के लिए फायदा ये है कि उसे HTML व  XHTML दोनों Languages को सीखने की जरूरत नहीं है। क्योंकि जब XHTML को Develop किया जा रहा था, तब इस बात का ध्यान रखा गया था कि XHTML उन Web Browsers के Compatible रहे, जो केवल HTML Pages को ही Display कर सकते हैं। कहने का मतलब ये है कि हम जितने भी XHTML Elements को उपयोग में लेना सीखेंगे, उनमें से लगभग सभी Elements HTML के 4.1 Version में भी उपलब्ध हैं। HTML से XHTML के बीच XHTML के तीन Versions को हमें ध्यान में रखना होता है।

Transitional XTHML 1.0

XHTML के इस Version में एक Developer उन HTML Markup को भी उपयोग में ले सकता है, जिन्हें HTML के 4.01 Version में Deprecated Declare कर दिया गया था, लेकिन इस Version में भी Developer को Stricter Syntax Use करने का ध्यान रखना होता है।

Strict XHTML 1.0

XHTML के इस Version में एक Developer उन HTML Markup को उपयोग में नहीं ले सकता है, जिन्हें HTML के 4.01 Version में Deprecated Declare कर दिया गया था, साथ ही इस Version में भी Developer को Stricter Syntax Use करने का ध्यान रखना होता है।

Frameset XHTML 1.0

XHTML के इस Version में एक Developer उस Technology का प्रयोग कर सकता है, जिसे Frames कहते हैं। यानी इस Version में हम एक ही Browser में एक से ज्यादा Web Pages को Open कर सकते हैं। इसके बारे में हम बाद में पढेंगे। इस Version में भी Developer को Stricter Syntax Use करने का ध्यान रखना होता है।
सामान्यतया हम Transitional XTHML 1.0 Version के Elements को ही उपयोग में लेंगे, क्योंकि ये Version HTML 4.01 Version के Elements को भी Support करता है। लेकिन जहां तक हो सके हमें XHTML के Elements का ही प्रयोग करना चाहिए। जब हम केवल Pure XHTML के Elements ही उपयोग में लेते हैं और Deprecated Elements व Attributes का प्रयोग नहीं करते हैं, तब हमारा Page स्‍वयं ही Strict XHTML 1.0 का Page बन जाता है।

XHTML और HTML में अंतर

XHTML के नियमों को समझ लें, तो हम इन दोनों Languages के बीच के आपसी अन्‍तर को भी समझ सकते हैं। XHTML के विभिन्न Restrictions व विशेषताएं निम्नानुसार हैं:

Include XML Declaration

HTML की तुलना में XHTML के Syntax ज्यादा Strict होते हैं। चूंकि XHTML को XML में लिखा गया है, इसलिए जब हम एक XHTML Document बनाते हैं, तब वास्तव में हम एक XML Document भी बना रहे होते हैं। इसलिए हम हमारे Document की शुरूआत निम्नानुसार एक Optional Line से भी कर सकते हैं, जो कि सभी XML Documents में एक Optional Declaration होता है।
<?xml version=”1.0” encoding=”UTF-8” ?>
 
यदि हम हमारे Document में इस XML Declaration को Include करते हैं, तो ये Statement हमारे Document का सबसे पहला Statement होना जरूरी होता है, यहां तक कि इस Statement से पहले एक Blank Space भी नहीं होना चाहिए। इस Statement द्वारा हम अपने Web Browser को ये बताते हैं कि हम हमारे Document में XML के 1.0 Version के Standards के आधार पर नए Elements भी Create करने की सुविधा प्राप्त करना चाहते हैं और encoding Attribute द्वारा हम ये बताते हैं कि हम हमारे Document में किस Encoding को Support करवाना चाहते हैं। उदाहरण के लिए यदि हम हमारे Web Page में हिन्दी भाषा में भी Contents लिखना चाहते हैं और हम चाहते हैं कि इस भाषा में लिखे गए Content को दुनियां के सभी नए Web Browsers बिना किसी परेशानी के दिखा सकें, तो हमें Encoding के रूप में “UTF-8” को चुनना होता है, क्योंकि हिन्दी भाशा के Unicode इसी Encoding के अन्‍तर्गत Defined हैं।

Include a DOCTYPE Declaration

DOCTYPE Declaration इस बात को Indicate करता है कि हम HTML/XHTML के कौनसे Version को उपयोग में ले रहे हैं। इसे Opening <html> Tag को Use करने से पहले Specify किया जाता है। यदि हम हमारे Document में Transitional XHTML 1.0 Version के आधार पर Coding कर रहे हैं, जिसमें हम पुराने HTML 4.01 Version के Elements को Use करना चाहते हैं, तो हमें हमारे Web Browser को ये बात निम्नानुसार बतानी होती है:
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
इसके बजाय यदि हम Strict XHTML 1.0 Version के आधार पर अपने Web Pages तैयार कर रहे हों, तो हमें अपने Web Page में निम्न DOCTYPE Declaration Statement को उपयोग में लेना होता है:
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
जबकि यदि हम हमारे Document में Frameset का प्रयोग करना चाहते हैं, तो हमें हमारे Web Page में निम्न DOCTYPE Declaration Statement को Use करना होता है:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
 
Strict XHTML Documents में हमें DOCTYPE Declaration Statement को <html> Tag से पहले Use करना जरूरी होता है, जबकि यदि हम Transitional अथवा Frameset Document Create कर रहे हों, तो हम इस Declaration को छोड भी सकते हैं।

HTML के Versions और <!DOCTYPE> Declaration

                         <!DOCTYPE> declaration किसी वेब पेज को browser में सही तरीके से प्रदर्शित करने मे सहायता करता है।

HTML के विभिन्न वर्जनों के सामान्य Declarations है –

Version
Year
<!DOCTYPE> declaration
HTML
1991

HTML+
1993

HTML 2.0
1995

HTML 3.2
1997

HTML 4.01 Strict
1999
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
HTML 4.01 Transitional
1999
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
HTML 4.01 Frameset
1999
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
XHTML 1.0 Strict
2000
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
XHTML 1.0 Transitional

2000
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
XHTML 1.0 Frameset

2000
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
XHTML 1.1

2000
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
HTML5
2012
<!DOCTYPE html>
XHTML5
2013

Use Lowercase Names

एक HTML Document में हम Uppercase अथवा Lowercase किसी भी तरह के Case में HTML Elements व Attributes को लिख सकते हैं, लेकिन XHTML Document में हमें सभी Element व  Attribute को Lowercase में लिखना जरूरी होता है। हालांकि Elements के बीच के Contents व Attributes के मान Case Sensitive नहीं होते हैं।

Close All Tags Correctly

XHTML में हमें हर Open होने वाले Tag को ठीक तरह से Close करना जरूरी होता है। हम केवल उसी स्थिति में किसी Tag  को Close करने से बच सकते हैं, जबकि वह Tag एक Empty Tag हो। HTML में हम किसी Paragraph को निम्नानुसार लिख सकते हैं:

<p> This is a HTML Paragraph Element.
<p> HTML could leave the closing tag.


जबकि इसी Paragraph को यदि हम XHTML में लिखें, तो हमें ये Paragraph Element निम्नानुसार Use करना होगा:

<p> This is a XHTML Paragraph Element. </p>
<p> XHTML could not leave the closing tag. </p>
जितनी बार भी एक XHTML Browser एक नए <p> Tag  को Run करता है, वह पिछले </p> Tag के अन्‍त को स्‍वयं ही मान लेता है, लेकिन XHTML तब तक नए Paragraph को नहीं मानता, जब‍ तक कि उसे पहले वाले Paragraph का Closing Tag प्राप्त नहीं हो जाता। इसलिए XHTML में हमें हर Tag को ठीक तरह से Close करना जरूरी होता है।
कुछ Tags ऐसे होते हैं, जिनके Opening व Closing Tag के बीच कोई Content नहीं होता। इस प्रकार के Tags को Empty Tag कहा जाता है। <img> व  <br> एसे ही Empty Tags हैं। इन्‍हें HTML में तो एसे ही लिखा जाता है, लेकिन जब हम XHTML Document बनाते हैं, तब हमें इन Empty Tags को भी Forward Slash के साथ लिखना होता है। यानी हमें इन्‍हें <img /> व <br /> लिखना पडता है।

Attribute Values

जब हम XHTML Attributes को कोई मान प्रदान करते हैं, तब हमें तीन बातें ध्यान में रखनी होती हैं। सबसे पहली बात ये कि हर Value को Double Quotes के बीच Enclosed रखना जरूरी होता है। दूसरी बात ये कि हर Attribute को मान प्रदान करना जरूरी होता है और तीसरी बात ये कि Value के पहले व बाद के Spaces Remove हो जाते हैं, इसलिए हमें Spaces के सम्‍बं‍ध में ध्यान रखने की जरूरत नहीं होती है।

HTML Element Must Be The Root Element

किसी भी XHTML Document की शुरूआत हमेंशा <html> Opening Tag से होती है व अन्‍त हमेंशा </html> Closing Tag से होती है। <html> Tag से पहले केवल XML Declaration व  DOCTYPE Declaration Statements ही आ सकते हैं, क्योंकि सभी XML Documents में एक Unique Root Element होना जरूरी होता है, जो कि बाकी के पूरे Document को अपने में Included या Contained रखता है। हमारे XHTML Document के सन्‍दर्भ में वह Root Element <html> Tag है।

Tags Must Nest Properly

XHTML Document में हम जिस Tag को सबसे पहले Open करते हैं, उसे सबसे बाद में व जिस Tag को सबसे बाद में Open करते हैं, उसे सबसे पहले Close करना जरूरी होता है। यदि हम एक साथ एक से ज्यादा Tags को Open करते हैं, तो हमें इस बात का ध्यान रखना होता है। उदाहरण के लिए निम्न Statement में पहले <p> Tag को Open किया है और बाद में <em> Tag को इसलिए सबसे पहले हमें <em> Tag को Close करना होता है और बाद में <p> Tag को।

<p> This is a <em>HTML Paragraph Element. </em></p>

जिन उपरोक्‍त नियमों का हमें XHTML Document बनाते समय ध्यान रखना जरूरी होता है, HTML Document बनाते समय हमें इन नियमों को ध्यान में रखने की जरूरत नहीं होती है। HTML व XHTML Document Creation में ये ही मुख्य अन्‍तर हैं।

Creating First HTML Page - HTML Tags and Elements


अब हम पहला HTML Web Page बनाते हैं। इस Page द्वारा हम विभिन्‍न प्रकार के Basic Concepts को समझ सकते हैं।

<!DOCTYPE html>
<html>
<head>
<title>HTML – Fast Track Course </title>
</head>
<body>
<h1>HTML – Introduction </h1>
<p>
document type को पारिभाषित करता है । यह HTML5 वर्जन मे काम आता है । यह प्रदर्शित नही होता है यानि यह छुपा हुआ होता है । यहहमारे web page के सभी अन्य elements को लिखा जाता है। यह प्रदर्शित नही होता है यानि यह छुपा हुआ होता है ।
</p>
</body>
</html>
  • <!DOCTYPE html> - document type को पारिभाषित करता है । यह HTML5 वर्जन मे काम आता है । यह प्रदर्शित नही होता है यानि यह छुपा हुआ होता है ।
  • <html> और </html>  के बीच में हमारे web page के सभी अन्य elements को लिखा जाता है। यह प्रदर्शित नही होता है यानि यह छुपा हुआ होता है ।
  • <body> और </body> के बीच में जो page content लिखा जाता है वह हमे हमारे web page में दिखाई देता है ।
  • <h1> और </h1>  के बीच जो लिखा जाता है वह heading की तरह दिखता है ।
  • <p> और </p> के बीच जो लिखा जाता है वह paragraph की तरह दिखता है ।
इस Example को Notepad में Type करके sample.htm नाम के साथ IIS Local Host के wwwroot Folder में अथवा WAMP के www Folder में अथवा XAMPP के htdocs Folder में “mysite” नाम का एक Sub-Folder Create करके उसमें Save करें और Web Browser को Open करके उसके Address Bar में http://localhost/mysite/sample.htm Type करके Enter करें। 

इस Web Page पर हम Title Bar में Page का Title, Heading व Paragraph देख सकते हैं, जो कि हमने Notepad में Type किया था, लेकिन हमने Notepad में जिन HTML Tags को Use किया था, वे HTML Tags हमें दिखाई नहीं दे रहे हैं, क्योंकि वे सभी Tags Document को Browser में Structure या Organize करने के उपयोग में आ गए हैं। Web Page Create करते समय हमने जो Texts Angle Brackets के बीच लिखे थे, वे सभी HTML Tags थे जबकि अन्‍य Texts वे Information हैं, जिन्हें हम Browser में Render करना चाहते थे।

HTML Tags क्या होते है ?

  1. HTML tags कुछ शब्द (tag names) होते है, जो किसी शब्द को दोनो और से Angle brackets (<……..>) से बाँधते है, जैसे -  <html>
  2. HTML tags सामान्यत: जोडे मे होते है, जैसे <b> और </b>
  3. जोडे का पहला tag - start tag, और दुसरा tag - end tag कहलाता है ।
  4. end tag भी start tag की तरह ही लिखा जाता है, पर इसमें tag के नाम के पहले forward slash ( / )
  5.  Start and end tags को opening tags और closing tags भी कहा जाता है ।
Example -  <tagname> आपका content </tagname>

HTML Elements क्या होते है ?

                                       "HTML tags" और "HTML elements" को सामान्यत: एक ही वस्तु कहा जाता है। पर असल में, एक HTML element वह सब कुछ है जो start tag और end tag के बीच लिखा जाता है:
 Example -  <p>This is a paragraph.</p>
                    यदि हम अपने Example की पहली व आखिरी Code Line को देखें, तो हम एक HTML Tag Pair को देख सकते हैं जिसमें <html></html> लिखा गया है। दो Opening and Closing Angle Brackets व उसमें लिखे गए Texts को Tag कहा जाता है। हम देख सकते हैं कि हमारे Example में बहुत सारे Tags का प्रयोग किया गया है।
हमारे उदाहरण में हर Tag एक जोडे के रूप में है। Opening Tag व Closing Tag में केवल इतना अन्‍तर होता है कि Closing Tag में हमेंशा एक Forward Slash का प्रयोग किया जाता है। जब एक HTML Tag Pair के बीच कुछ Information Texts को लिखा जाता है, तब बनने वाले पूरे Statement को Element कहा जाता है। 

HTML Tag and Element

पिछले उदाहरण में हमने सबसे पहले <html></html> Tag Pair को उपयोग में लिया है। किसी भी Web Page में लिखा जाने वाला ये एक जरूरी Element है, क्योंकि Web Page में जो कुछ भी दिखाई देता है, वह सबकुछ इसी Tag Pair में लिखा जाना जरूरी होता है।
हर <html></html> Tag Pair के हमेंशा दो हिस्से होते हैं, जिनमें पहला हिस्सा Web Browser व Search Engines से सम्बंधित जानकारियों के लिए होता है। इस हिस्से को <head></head> Tag Pair के रूप में Identify किया जाता है, जबकि दूसरा हिस्सा <body></body> Tag Pair के रूप में होता है और हम अपने Web Page को Structure करने के लिए जितने भी Tags उपयोग में लेते हैं उन सभी Tags को यहीं Use करना होता है।
उदाहरण के लिए Web Page का Title Web Browser के Title Bar में दिखाई देता है, इसलिए <title></title> Tag Pair को हमने <head> Element में उपयोग में लिया है, जबकि अपने Web Page के Contents की Heading को Web Browser में Render करने के लिए हमने <h1> Element का प्रयोग <body> Element में किया है।
हमने पहले भी उल्लेख किया था कि Markup Tags Documents में किसी Text को Highlight करने अथवा उसे Special Meaning देने का काम करते हैं। ये Tags Browser को जो Special Meaning देते हैं, वे Description ही Document को Structure करते हैं। हमारे उदाहरण में जब हम <h1> Opening Tag User करते हैं, तो ये Tab Web Browser को बताता है कि यहां से Heading 1 का Text शुरू हो रहा है, जबकि </h1> Closing Tag Web Browser को बताता है, कि यहां पर Heading 1 का Text समाप्त हो रहा है। यदि हम इन Tags का प्रयोग ना करें, तो सारे Texts Web Browser के लिए सामान्य Texts होंगे और Browser किसी भी Text को अलग तरह से Markup या Highlight नहीं करेगा।
                 विभिन्न प्रकार के HTML Tags ही Web Browser को बताते है, कि किस Text को Heading के रूप में Render करना है और किस Text को सामान्य Paragraph क रूप में। कई बार हमें एक Element के अन्दर दूसरे Element की Nesting करनी पडती है। इस स्थिति में Outer Element Parent Element कहलाता है, जबकि Inner Element Child Element कहलाता है।

HTML5


HTML5 क्या है ?

HTML5 नया HTML Standard है।

HTML5

  • New Elements
  • New Attributes
  • Full CSS3 Support
  • Video and Audio
  • 2D/3D Graphics
  • Local Storage
  • Local SQL Database
  • Web Applications

What is HTML5?

HTML5 नया HTML Standard है।
HTML का पुराना version, HTML 4.01, 1999 मे आया था । तब से अब तक web मे बहुत से बदलाव हुए है।
HTML5 अभी भी अपडेट हो रहा है। फ़िर भी, अधिकतर browsers बहुत से नये HTML5 elements और APIs को support करते है।

HTML5 की शुरुआत कैसे हुई ?

HTML5 - World Wide Web Consortium (W3C) और Web Hypertext Application Technology Working Group (WHATWG) के बीच cooperation का परिणाम है।
2006 में, WHATWG web forms और applications पर काम कर रहा था, और W3C XHTML 2.0 पर काम कर रहा था, उन्होने cooperate करने का निश्चय किया और HTML का नया version बनाया।
Some rules for HTML5 were established:
  • नये features HTML, CSS, DOM, और JavaScript पर base हो सकते है।
  • Reduce the need for external plugins (like Flash)
  • Better error handling
  • More markup to replace scripting
  • HTML5 should be device independent
  • The development process should be visible to the public

The HTML5 <!DOCTYPE>

HTML5 मे सिर्फ़ एक <!doctype> declaration होता है जो कि बेहद सरल है :
<!DOCTYPE html>


Minimum HTML5 Document

HTML5 पेज का शुरुआती उदाहरण निम्न है :
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>

<body>
The content of the document......
</body>

</html>




HTML5 - New Features

HTML5 के कुछ नये एवं बेहद रोचक features है :
  • 2D drawing के लिए <canvas> element 
  • media playback के लिए <video> और <audio> elements
  • local storage को Support करता है।
  • नये content-specific elements, जैसे- <article>, <footer>, <header>, <nav>, <section>
  • नये form controls, जैसे- calendar, date, time, email, url, search

Browser Support for HTML5

HTML5 is not yet an official standard, and no browsers have full HTML5 support.
But all major browsers (Safari, Chrome, Firefox, Opera, Internet Explorer) continue to add new HTML5 features to their latest versions.

HTML Quick List


HTML tools की एक Quick List जिससे आप उपरिक्त सभी को अच्छी तरह समझ सकते है। Print करो, मोडों, और अपनी जेब मे रखों।

HTML पेज की शुरुआत (HTML Basic Document)

<!DOCTYPE html>
<html>
<head>
<title>Title of document goes here</title>
</head>

<body>
Visible text goes here...
</body>
</html>

शुरुआती Tags (Basic Tags)

<h1>Largest Heading</h1>
<h2> . . . </h2>
<h3> . . . </h3>
<h4> . . . </h4>
<h5> . . . </h5>
<h6>Smallest Heading</h6>

<p>This is a paragraph.</p>
<br> (line break)
<hr> (horizontal rule)
<!-- This is a comment -->

शब्दों के लिये (Formatting)

<b>Bold text</b>
<code>Computer code</code>
<em>Emphasized text</em>
<i>Italic text</i>
<kbd>Keyboard input</kbd>
<pre>Preformatted text</pre>
<small>Smaller text</small>
<strong>Important text</strong>

<abbr> (abbreviation)
<address> (contact information)
<bdo> (text direction)
<blockquote> (a section quoted from another source)
<cite> (title of a work)
<del> (deleted text)
<ins> (inserted text)
<sub> (subscripted text)
<sup> (superscripted text)


लिंक बनाने के लिये (Links)

Ordinary link: <a href="http://www.example.com/">Link-text goes here</a>
Image-link: <a href="http://www.example.com/"><img src="URL" alt="Alternate Text"></a>
Mailto link: <a href="mailto:webmaster@example.com">Send e-mail</a>
Bookmark:
<a id="tips">Tips Section</a>
<a href="#tips">Jump to the Tips Section</a>

चित्रों के लिये (Images)

<img src="URL" alt="Alternate Text" height="42" width="42">

Styles/Sections के लिये (Styles/Sections)

<style type="text/css">
  h1 {color:red;}
  p {color:blue;}
</style>

<div>A block-level section in a document</div>
<span>An inline section in a document</span>


डॉट वाली लिस्ट (Unordered list)

<ul>
  <li>Item</li>
  <li>Item</li>
</ul>


नम्बर वाली लिस्ट (Ordered list)

<ol>
  <li>First item</li>
  <li>Second item</li>
</ol>

व्याख्या वाली लिस्ट (Definition list)

<dl>
  <dt>Item 1</dt>
    <dd>Describe item 1</dd>
  <dt>Item 2</dt>
    <dd>Describe item 2</dd>
</dl>

टेबल (Tables)

<table border="1">
  <tr>
    <th>table header</th>
    <th>table header</th>
  </tr>
  <tr>
    <td>table data</td>
    <td>table data</td>
  </tr>
</table>

फ़्रेम्स (Iframe)

<iframe src="demo_iframe.htm"></iframe>

फ़ॉर्म (Forms)

<form action="demo_form.asp" method="post/get">
<input type="text" name="email" size="40" maxlength="50">
<input type="password">
<input type="checkbox" checked="checked">
<input type="radio" checked="checked">
<input type="submit" value="Send">
<input type="reset">
<input type="hidden">
<select>
<option>Apples</option>
<option selected="selected">Bananas</option>
<option>Cherries</option>
</select>

<textarea name="comment" rows="60" cols="20"></textarea>

</form>

विशेष शब्द (Entities)

&lt; is the same as <
&gt; is the same as >
&#169; is the same as ©



HTML Entities


कुछ शब्द  HTML  मे reserved होते है उन्हें हम प्रयोग नही कर सकते है। जैसे कि less than (<) या greater than (>) चिन्ह का प्रयोग नही किया जा सकता है, because the क्योकि browser उन्हें tags के साथ मिला देगा।
तो वास्तव मे reserved characters(शब्दों) को देखने के लिये, हमें HTML source code में character entities का प्रयोग करना होगा । character entity कुछ इस तरह दिखाई देती है:

&entity_name;
या
&#entity_number;
less than चिन्ह लिखने के लिये हमें: &lt; या &#60; लिखना होगा
नोट : एक number के स्थान पर entity name लिखने का फ़ायदा यह है कि नाम याद रखना आसान होता है, जबकि, नुकसान यह है कि browsers सभी entity names को support नही करते है (जबकि वे entity numbers को बहुत अच्छी तरह support करते).
नोट : Entity names case sensitive होते है !




Result
Description
Entity Name
Entity Number

non-breaking space
&nbsp;
&#160;
less than
&lt;
&#60;
greater than
&gt;
&#62;
&
ampersand
&amp;
&#38;
¢
cent
&cent;
&#162;
£
pound
&pound;
&#163;
¥
yen
&yen;
&#165;
euro
&euro;
&#8364;
§
section
&sect;
&#167;
©
copyright
&copy;
&#169;
®
registered trademark
&reg;
&#174;
trademark
&trade;
&#8482;



Non-breaking Space

HTML मे सामान्यत: प्रयुक्त होने वाला character entity है non-breaking space (&nbsp;).
Browsers हमेशा HTML पेजों मे कुछ spaces घटा (truncate) देता है। यदि आपने अपने वाक्य मे 10 spaces दिये है तो पेज प्रदर्शित होने से पूर्व browser उनमें से 9 घटा देता । तो अपने  वाक्यों में spaces जोडने के लिये आपको &nbsp; character entity का प्रयोग करना होगा ।



ASCII Character
HTML Entity Code
Description

&#32;
space
!
&#33;
exclamation mark
"
&#34;
quotation mark
#
&#35;
number sign
$
&#36;
dollar sign
%
&#37;
percent sign
&
&#38;
ampersand
'
&#39;
apostrophe
(
&#40;
left parenthesis
)
&#41;
right parenthesis
*
&#42;
asterisk
+
&#43;
plus sign
,
&#44;
comma
-
&#45;
hyphen
.
&#46;
period
/
&#47;
slash
0
&#48;
digit 0
1
&#49;
digit 1
2
&#50;
digit 2
3
&#51;
digit 3
4
&#52;
digit 4
5
&#53;
digit 5
6
&#54;
digit 6
7
&#55;
digit 7
8
&#56;
digit 8
9
&#57;
digit 9
:
&#58;
colon
;
&#59;
semicolon
&#60;
less-than
=
&#61;
equals-to
&#62;
greater-than
?
&#63;
question mark
@
&#64;
at sign
A
&#65;
uppercase A
B
&#66;
uppercase B
C
&#67;
uppercase C
D
&#68;
uppercase D
E
&#69;
uppercase E
F
&#70;
uppercase F
G
&#71;
uppercase G
H
&#72;
uppercase H
I
&#73;
uppercase I
J
&#74;
uppercase J
K
&#75;
uppercase K
L
&#76;
uppercase L
M
&#77;
uppercase M
N
&#78;
uppercase N
O
&#79;
uppercase O
P
&#80;
uppercase P
Q
&#81;
uppercase Q
R
&#82;
uppercase R
S
&#83;
uppercase S
T
&#84;
uppercase T
U
&#85;
uppercase U
V
&#86;
uppercase V
W
&#87;
uppercase W
X
&#88;
uppercase X
Y
&#89;
uppercase Y
Z
&#90;
uppercase Z
[
&#91;
left square bracket
\
&#92;
backslash
]
&#93;
right square bracket
^
&#94;
caret
_
&#95;
underscore
`
&#96;
grave accent
a
&#97;
lowercase a
b
&#98;
lowercase b
c
&#99;
lowercase c
d
&#100;
lowercase d
e
&#101;
lowercase e
f
&#102;
lowercase f
g
&#103;
lowercase g
h
&#104;
lowercase h
i
&#105;
lowercase i
j
&#106;
lowercase j
k
&#107;
lowercase k
l
&#108;
lowercase l
m
&#109;
lowercase m
n
&#110;
lowercase n
o
&#111;
lowercase o
p
&#112;
lowercase p
q
&#113;
lowercase q
r
&#114;
lowercase r
s
&#115;
lowercase s
t
&#116;
lowercase t
u
&#117;
lowercase u
v
&#118;
lowercase v
w
&#119;
lowercase w
x
&#120;
lowercase x
y
&#121;
lowercase y
z
&#122;
lowercase z
{
&#123;
left curly brace
|
&#124;
vertical bar
}
&#125;
right curly brace
~
&#126;
tilde



ASCII Device Control Characters


ASCII Character
HTML Entity Code
Description
NUL
&#00;
null character
SOH
&#01;
start of header
STX
&#02;
start of text
ETX
&#03;
end of text
EOT
&#04;
end of transmission
ENQ
&#05;
enquiry
ACK
&#06;
acknowledge
BEL
&#07;
bell (ring)
BS
&#08;
backspace
HT
&#09;
horizontal tab
LF
&#10;
line feed
VT
&#11;
vertical tab
FF
&#12;
form feed
CR
&#13;
carriage return
SO
&#14;
shift out
SI
&#15;
shift in
DLE
&#16;
data link escape
DC1
&#17;
device control 1
DC2
&#18;
device control 2
DC3
&#19;
device control 3
DC4
&#20;
device control 4
NAK
&#21;
negative acknowledge
SYN
&#22;
synchronize
ETB
&#23;
end transmission block
CAN
&#24;
cancel
EM
&#25;
end of medium
SUB
&#26;
substitute
ESC
&#27;
escape
FS
&#28;
file separator
GS
&#29;
group separator
RS
&#30;
record separator
US
&#31;
unit separator



DEL
&#127;
delete (rubout)

ISO Character Sets


Character set
Description
Covers
ISO-8859-1
Latin alphabet part 1
North America, Western Europe, Latin America, the Caribbean, Canada, Africa
ISO-8859-2
Latin alphabet part 2
Eastern Europe
ISO-8859-3
Latin alphabet part 3
SE Europe, Esperanto, miscellaneous others
ISO-8859-4
Latin alphabet part 4
Scandinavia/Baltics (and others not in ISO-8859-1)
ISO-8859-5
Latin/Cyrillic part 5
The languages that are using a Cyrillic alphabet such as Bulgarian, Belarusian, Russian and Macedonian
ISO-8859-6
Latin/Arabic part 6
The languages that are using the Arabic alphabet
ISO-8859-7
Latin/Greek part 7
The modern Greek language as well as mathematical symbols derived from the Greek
ISO-8859-8
Latin/Hebrew part 8
The languages that are using the Hebrew alphabet
ISO-8859-9
Latin 5 part 9
The Turkish language. Same as ISO-8859-1 except Turkish characters replace Icelandic ones
ISO-8859-10
Latin 6 Lappish, Nordic, Eskimo
The Nordic languages
ISO-8859-15
Latin 9 (aka Latin 0)
Similar to ISO 8859-1 but replaces some less common symbols with the euro sign and some other missing characters
ISO-2022-JP
Latin/Japanese part 1
The Japanese language
ISO-2022-JP-2
Latin/Japanese part 2
The Japanese language
ISO-2022-KR
Latin/Korean part 1
The Korean language



The Unicode Standard


Character-set
Description
UTF-8
A character in UTF8 can be from 1 to 4 bytes long. UTF-8 can represent any character in the Unicode standard. UTF-8 is backwards compatible with ASCII. UTF-8 is the preferred encoding for e-mail and web pages
UTF-16
16-bit Unicode Transformation Format is a variable-length character encoding for Unicode, capable of encoding the entire Unicode repertoire. UTF-16 is used in major operating systems and environments, like Microsoft Windows 2000/XP/2003/Vista/CE and the Java and .NET byte code environments
Tip: The first 256 characters of Unicode character-sets correspond to the 256 characters of ISO-8859-1.
Tip: All HTML 4 processors already support UTF-8, and all XHTML and XML processors support UTF-8 and UTF-16!



Math Symbols Supported by HTML
Character
Entity Number
Entity Name
Description
&#8704;
&forall;
for all
&#8706;
&part;
part
&#8707;
&exist;
exists
&#8709;
&empty;
empty
&#8711;
&nabla;
nabla
&#8712;
&isin;
isin
&#8713;
&notin;
notin
&#8715;
&ni;
ni
&#8719;
&prod;
prod
&#8721;
&sum;
sum
&#8722;
&minus;
minus
&#8727;
&lowast;
lowast
&#8730;
&radic;
square root
&#8733;
&prop;
proportional to
&#8734;
&infin;
infinity
&#8736;
&ang;
angle
&#8743;
&and;
and
&#8744;
&or;
or
&#8745;
&cap;
cap
&#8746;
&cup;
cup
&#8747;
&int;
integral
&#8756;
&there4;
therefore
&#8764;
&sim;
similar to
&#8773;
&cong;
congruent to
&#8776;
&asymp;
almost equal
&#8800;
&ne;
not equal
&#8801;
&equiv;
equivalent
&#8804;
&le;
less or equal
&#8805;
&ge;
greater or equal
&#8834;
&sub;
subset of
&#8835;
&sup;
superset of
&#8836;
&nsub;
not subset of
&#8838;
&sube;
subset or equal
&#8839;
&supe;
superset or equal
&#8853;
&oplus;
circled plus
&#8855;
&otimes;
circled times
&#8869;
&perp;
perpendicular
&#8901;
&sdot;
dot operator

Greek Letters Supported by HTML

Character
Entity Number
Entity Name
Description
Α
&#913;
&Alpha;
Alpha
Β
&#914;
&Beta;
Beta
Γ
&#915;
&Gamma;
Gamma
Δ
&#916;
&Delta;
Delta
Ε
&#917;
&Epsilon;
Epsilon
Ζ
&#918;
&Zeta;
Zeta
Η
&#919;
&Eta;
Eta
Θ
&#920;
&Theta;
Theta
Ι
&#921;
&Iota;
Iota
Κ
&#922;
&Kappa;
Kappa
Λ
&#923;
&Lambda;
Lambda
Μ
&#924;
&Mu;
Mu
Ν
&#925;
&Nu;
Nu
Ξ
&#926;
&Xi;
Xi
Ο
&#927;
&Omicron;
Omicron
Π
&#928;
&Pi;
Pi
Ρ
&#929;
&Rho;
Rho

undefined

Sigmaf
Σ
&#931;
&Sigma;
Sigma
Τ
&#932;
&Tau;
Tau
Υ
&#933;
&Upsilon;
Upsilon
Φ
&#934;
&Phi;
Phi
Χ
&#935;
&Chi;
Chi
Ψ
&#936;
&Psi;
Psi
Ω
&#937;
&Omega;
Omega




α
&#945;
&alpha;
alpha
β
&#946;
&beta;
beta
γ
&#947;
&gamma;
gamma
δ
&#948;
&delta;
delta
ε
&#949;
&epsilon;
epsilon
ζ
&#950;
&zeta;
zeta
η
&#951;
&eta;
eta
θ
&#952;
&theta;
theta
ι
&#953;
&iota;
iota
κ
&#954;
&kappa;
kappa
λ
&#955;
&lambda;
lambda
μ
&#956;
&mu;
mu
ν
&#957;
&nu;
nu
ξ
&#958;
&xi;
xi
ο
&#959;
&omicron;
omicron
π
&#960;
&pi;
pi
ρ
&#961;
&rho;
rho
ς
&#962;
&sigmaf;
sigmaf
σ
&#963;
&sigma;
sigma
τ
&#964;
&tau;
tau
υ
&#965;
&upsilon;
upsilon
φ
&#966;
&phi;
phi
χ
&#967;
&chi;
chi
ψ
&#968;
&psi;
psi
ω
&#969;
&omega;
omega




ϑ
&#977;
&thetasym;
theta symbol
ϒ
&#978;
&upsih;
upsilon symbol
ϖ
&#982;
&piv;
pi symbol

Other Entities Supported by HTML

Character
Entity Number
Entity Name
Description
Œ
&#338;
&OElig;
capital ligature OE
œ
&#339;
&oelig;
small ligature oe
Š
&#352;
&Scaron;
capital S with caron
š
&#353;
&scaron;
small S with caron
Ÿ
&#376;
&Yuml;
capital Y with diaeres
ƒ
&#402;
&fnof;
f with hook
ˆ
&#710;
&circ;
modifier letter circumflex accent
˜
&#732;
&tilde;
small tilde
&#8194;
&ensp;
en space
&#8195;
&emsp;
em space
&#8201;
&thinsp;
thin space
&#8204;
&zwnj;
zero width non-joiner
&#8205;
&zwj;
zero width joiner
&#8206;
&lrm;
left-to-right mark
&#8207;
&rlm;
right-to-left mark
&#8211;
&ndash;
en dash
&#8212;
&mdash;
em dash
&#8216;
&lsquo;
left single quotation mark
&#8217;
&rsquo;
right single quotation mark
&#8218;
&sbquo;
single low-9 quotation mark
&#8220;
&ldquo;
left double quotation mark
&#8221;
&rdquo;
right double quotation mark
&#8222;
&bdquo;
double low-9 quotation mark
&#8224;
&dagger;
dagger
&#8225;
&Dagger;
double dagger
&#8226;
&bull;
bullet
&#8230;
&hellip;
horizontal ellipsis
&#8240;
&permil;
per mille 
&#8242;
&prime;
minutes
&#8243;
&Prime;
seconds
&#8249;
&lsaquo;
single left angle quotation
&#8250;
&rsaquo;
single right angle quotation
&#8254;
&oline;
overline
&#8364;
&euro;
euro
&#8482; or &#153;
&trade;
trademark
&#8592;
&larr;
left arrow
&#8593;
&uarr;
up arrow
&#8594;
&rarr;
right arrow
&#8595;
&darr;
down arrow
&#8596;
&harr;
left right arrow
&#8629;
&crarr;
carriage return arrow
&#8968;
&lceil;
left ceiling
&#8969;
&rceil;
right ceiling
&#8970;
&lfloor;
left floor
&#8971;
&rfloor;
right floor
&#9674;
&loz;
lozenge
&#9824;
&spades;
spade
&#9827;
&clubs;
club
&#9829;
&hearts;
heart
&#9830;
&diams;
diamond


Reserved Characters in HTML


Character
Entity Number
Entity Name
Description
"
&#34;
&quot;
quotation mark
'
&#39;
&apos;
apostrophe 
&
&#38;
&amp;
ampersand
&#60;
&lt;
less-than
&#62;
&gt;
greater-than
Note: Entity names are case sensitive!


ISO 8859-1 Symbols

Character
Entity Number
Entity Name
Description

&#160;
&nbsp;
non-breaking space
¡
&#161;
&iexcl;
inverted exclamation mark
¢
&#162;
&cent;
cent
£
&#163;
&pound;
pound
¤
&#164;
&curren;
currency
¥
&#165;
&yen;
yen
¦
&#166;
&brvbar;
broken vertical bar
§
&#167;
&sect;
section
¨
&#168;
&uml;
spacing diaeresis
©
&#169;
&copy;
copyright
ª
&#170;
&ordf;
feminine ordinal indicator
«
&#171;
&laquo;
angle quotation mark (left)
¬
&#172;
&not;
negation
­­
&#173;
&shy;
soft hyphen
®
&#174;
&reg;
registered trademark
¯
&#175;
&macr;
spacing macron
°
&#176;
&deg;
degree
±
&#177;
&plusmn;
plus-or-minus 
²
&#178;
&sup2;
superscript 2
³
&#179;
&sup3;
superscript 3
´
&#180;
&acute;
spacing acute
µ
&#181;
&micro;
micro
&#182;
&para;
paragraph
·
&#183;
&middot;
middle dot
¸
&#184;
&cedil;
spacing cedilla
¹
&#185;
&sup1;
superscript 1
º
&#186;
&ordm;
masculine ordinal indicator
»
&#187;
&raquo;
angle quotation mark (right)
¼
&#188;
&frac14;
fraction 1/4
½
&#189;
&frac12;
fraction 1/2
¾
&#190;
&frac34;
fraction 3/4
¿
&#191;
&iquest;
inverted question mark
×
&#215;
&times;
multiplication
÷
&#247;
&divide;
division

ISO 8859-1 Characters

Character
Entity Number
Entity Name
Description
À
&#192;
&Agrave;
capital a, grave accent
Á
&#193;
&Aacute;
capital a, acute accent
Â
&#194;
&Acirc;
capital a, circumflex accent
Ã
&#195;
&Atilde;
capital a, tilde
Ä
&#196;
&Auml;
capital a, umlaut mark
Å
&#197;
&Aring;
capital a, ring
Æ
&#198;
&AElig;
capital ae
Ç
&#199;
&Ccedil;
capital c, cedilla
È
&#200;
&Egrave;
capital e, grave accent
É
&#201;
&Eacute;
capital e, acute accent
Ê
&#202;
&Ecirc;
capital e, circumflex accent
Ë
&#203;
&Euml;
capital e, umlaut mark
Ì
&#204;
&Igrave;
capital i, grave accent
Í
&#205;
&Iacute;
capital i, acute accent
Î
&#206;
&Icirc;
capital i, circumflex accent
Ï
&#207;
&Iuml;
capital i, umlaut mark
Ð
&#208;
&ETH;
capital eth, Icelandic
Ñ
&#209;
&Ntilde;
capital n, tilde
Ò
&#210;
&Ograve;
capital o, grave accent
Ó
&#211;
&Oacute;
capital o, acute accent
Ô
&#212;
&Ocirc;
capital o, circumflex accent
Õ
&#213;
&Otilde;
capital o, tilde
Ö
&#214;
&Ouml;
capital o, umlaut mark
Ø
&#216;
&Oslash;
capital o, slash
Ù
&#217;
&Ugrave;
capital u, grave accent
Ú
&#218;
&Uacute;
capital u, acute accent
Û
&#219;
&Ucirc;
capital u, circumflex accent
Ü
&#220;
&Uuml;
capital u, umlaut mark
Ý
&#221;
&Yacute;
capital y, acute accent
Þ
&#222;
&THORN;
capital THORN, Icelandic
ß
&#223;
&szlig;
small sharp s, German
à
&#224;
&agrave;
small a, grave accent
á
&#225;
&aacute;
small a, acute accent
â
&#226;
&acirc;
small a, circumflex accent
ã
&#227;
&atilde;
small a, tilde
ä
&#228;
&auml;
small a, umlaut mark
å
&#229;
&aring;
small a, ring
æ
&#230;
&aelig;
small ae
ç
&#231;
&ccedil;
small c, cedilla
è
&#232;
&egrave;
small e, grave accent
é
&#233;
&eacute;
small e, acute accent
ê
&#234;
&ecirc;
small e, circumflex accent
ë
&#235;
&euml;
small e, umlaut mark
ì
&#236;
&igrave;
small i, grave accent
í
&#237;
&iacute;
small i, acute accent
î
&#238;
&icirc;
small i, circumflex accent
ï
&#239;
&iuml;
small i, umlaut mark
ð
&#240;
&eth;
small eth, Icelandic
ñ
&#241;
&ntilde;
small n, tilde
ò
&#242;
&ograve;
small o, grave accent
ó
&#243;
&oacute;
small o, acute accent
ô
&#244;
&ocirc;
small o, circumflex accent
õ
&#245;
&otilde;
small o, tilde
ö
&#246;
&ouml;
small o, umlaut mark
ø
&#248;
&oslash;
small o, slash
ù
&#249;
&ugrave;
small u, grave accent
ú
&#250;
&uacute;
small u, acute accent
û
&#251;
&ucirc;
small u, circumflex accent
ü
&#252;
&uuml;
small u, umlaut mark
ý
&#253;
&yacute;
small y, acute accent
þ
&#254;
&thorn;
small thorn, Icelandic
ÿ
&#255;
&yuml;
small y, umlaut mark