4: Text Formatting
കഴിഞ്ഞ അധ്യായത്തിൽ headings, paragraphs, line breaks, thematic breaks എന്നിവ ഉപയോഗിച്ച് webpage-ന്റെ content എങ്ങനെ ക്രമീകരിക്കാമെന്ന് പഠിച്ചു. ഇനി ഒരു paragraph-ന്റെ ഉള്ളിലെ ചില വാക്കുകൾക്ക് പ്രത്യേക പ്രാധാന്യമോ അർത്ഥമോ നൽകുന്നത് എങ്ങനെയെന്ന് പഠിക്കാം. HTML-ൽ text formatting ചെയ്യുമ്പോൾ വെറും appearance മാത്രം നോക്കാതെ text-ന്റെ meaning കൂടി പരിഗണിക്കണം.
Text Formatting എന്താണ്?
ഒരു text-ന്റെ ചില ഭാഗങ്ങൾക്ക് പ്രാധാന്യം നൽകാനും, emphasis കാണിക്കാനും, highlight ചെയ്യാനും, deleted അല്ലെങ്കിൽ inserted content സൂചിപ്പിക്കാനും HTML-ൽ വിവിധ elements ഉപയോഗിക്കാം.
<p>This is <strong>important</strong> information.</p> <p>This word is <em>emphasized</em>.</p> <p>This is <mark>highlighted</mark> text.</p>
ഇവിടെ മൂന്ന് വ്യത്യസ്ത ആശയങ്ങളാണ് കാണിക്കുന്നത്. <strong> പ്രധാനപ്പെട്ട content സൂചിപ്പിക്കുന്നു, <em> emphasis നൽകുന്നു, <mark> ഒരു ഭാഗം highlight ചെയ്യുന്നതിന് ഉപയോഗിക്കുന്നു.
<strong> — പ്രധാനപ്പെട്ട Text
ഒരു text വളരെ പ്രധാനപ്പെട്ടതാണെന്ന് സൂചിപ്പിക്കാൻ <strong> ഉപയോഗിക്കാം. Browser സാധാരണയായി ഇത് bold ആയി കാണിക്കും. എന്നാൽ ഇതിന്റെ പ്രധാന ഉദ്ദേശ്യം text-ന് importance നൽകുകയാണ്.
<p><strong>Warning:</strong> Save your work before closing the application.</p>
ഇവിടെ Warning: എന്നത് പ്രധാനപ്പെട്ട information ആണെന്ന് <strong> വ്യക്തമാക്കുന്നു.
<em> — Emphasis
ഒരു വാക്കിനോ phrase-നോ പ്രത്യേക emphasis നൽകാൻ <em> ഉപയോഗിക്കാം. Browser ഇത് emphasis ആയി കാണിക്കും.
<p>You <em>must</em> complete this exercise.</p>
ഇവിടെ must എന്ന വാക്കിന് പ്രത്യേക emphasis നൽകുന്നു. <em> ഉപയോഗിക്കുമ്പോൾ അതിന്റെ semantic meaning കൂടി പരിഗണിക്കണം.
<b>യും <strong>ഉം
<b> text-നെ സാധാരണയായി bold appearance-ൽ കാണിക്കാൻ ഉപയോഗിക്കാം. <strong> എന്നാൽ text-ന് importance നൽകുന്നു. അതിനാൽ വെറും visual distinction ആവശ്യമുള്ള സാഹചര്യവും important information സൂചിപ്പിക്കേണ്ട സാഹചര്യവും തമ്മിൽ വ്യത്യാസപ്പെടുത്തണം.
<p><b>HTML</b> is a markup language.</p> <p><strong>Important:</strong> Save your file regularly.</p>
ഇവിടെ <b> text-നെ ശ്രദ്ധേയമാക്കുന്നതിനാണ് ഉപയോഗിച്ചിരിക്കുന്നത്. <strong> important information വ്യക്തമാക്കുന്നു.
<i>യും <em>ഉം
<i> text-നെ സാധാരണയായി italic appearance-ൽ കാണിക്കുന്നു. <em> എന്നാൽ emphasis എന്ന semantic meaning നൽകുന്നു. അതിനാൽ രണ്ടിനും ഒരേ visual result ലഭിച്ചാലും അവയുടെ ഉദ്ദേശ്യം ഒരുപോലെയല്ല.
<p>The word <i>HTML</i> is an abbreviation.</p> <p>You <em>really</em> need to practice.</p>
<u> — Underlined Text
<u> ഉപയോഗിച്ച് text-ന് underline annotation നൽകാം. സാധാരണയായി links ഇതിനകം underline ഉപയോഗിക്കുന്നതിനാൽ <u> അനാവശ്യമായി ഉപയോഗിക്കുന്നത് ഒഴിവാക്കുന്നതാണ് നല്ലത്.
<p>This is <u>underlined</u> text.</p>
<mark> — Highlighted Text
ഒരു text ഭാഗം വായനക്കാരന്റെ ശ്രദ്ധയിൽപ്പെടുത്താൻ <mark> ഉപയോഗിക്കാം. Browser സാധാരണയായി ഇത് highlighted text പോലെ കാണിക്കും.
<p>Please read the <mark>important section</mark> carefully.</p>
<small> — ചെറിയ പ്രാധാന്യമുള്ള Text
<small> element സാധാരണ content-നേക്കാൾ ചെറിയ text കാണിക്കുന്നതിനും side comments, copyright information തുടങ്ങിയ ചെറിയ കുറിപ്പുകൾ സൂചിപ്പിക്കുന്നതിനും ഉപയോഗിക്കാം.
<p>HTML is easy to learn.</p> <p><small>Course material © 2026</small></p>
<del> — Deleted Text
ഒരു text പിന്നീട് നീക്കം ചെയ്തതായി കാണിക്കാൻ <del&lgt; ഉപയോഗിക്കാം. Browser സാധാരണയായി deleted text-ന് ഒരു line കൂടി കാണിക്കും.
<p>Old price: <del>₹500</del></p> <p>New price: ₹350</p>
<ins> — Inserted Text
ഒരു document-ലേക്ക് പുതിയതായി ചേർത്ത text സൂചിപ്പിക്കാൻ <ins> ഉപയോഗിക്കാം. ഇത് സാധാരണയായി underline ആയി കാണപ്പെടുന്നു.
<p>The course has <ins>new practice exercises</ins>.</p>
<del>യും <ins>ഉം ഒരുമിച്ച്
ഒരു പഴയ വിവരത്തിന് പകരം പുതിയ വിവരം നൽകിയതായി കാണിക്കുമ്പോൾ <del>-ഉം <ins>-ഉം ഒരുമിച്ച് ഉപയോഗിക്കാം.
<p>Course fee: <del>₹1000</del> <ins>₹800</ins></p>
<s> — ഇനി ശരിയല്ലാത്ത Text
ഇനി ശരിയായതോ പ്രസക്തമായതോ അല്ലാത്ത text സൂചിപ്പിക്കാൻ <s> ഉപയോഗിക്കാം. ഇത് <del>-നോട് സാമ്യമുള്ളതായി തോന്നാം, എന്നാൽ രണ്ടിന്റെയും meaning വ്യത്യസ്തമാണ്. <del> ഒരു document-ൽ നിന്ന് content നീക്കം ചെയ്തതായി സൂചിപ്പിക്കുമ്പോൾ <s> ആ content ഇനി ശരിയല്ല അല്ലെങ്കിൽ relevant അല്ലെന്ന് സൂചിപ്പിക്കാം.
<p><s>Registration is open until Monday.</s></p> <p>Registration is now closed.</p>
Subscript — <sub>
ഒരു character അല്ലെങ്കിൽ text-നെ baseline-ന് താഴെയായി കാണിക്കാൻ <sub> ഉപയോഗിക്കുന്നു. Chemical formulas പോലുള്ള സാഹചര്യങ്ങളിൽ ഇത് ഉപയോഗപ്രദമാണ്.
<p>Water: H<sub>2</sub>O</p> <p>Carbon dioxide: CO<sub>2</sub></p>
Superscript — <sup>
ഒരു character അല്ലെങ്കിൽ text-നെ baseline-ന് മുകളിലായി കാണിക്കാൻ <sup> ഉപയോഗിക്കുന്നു. Mathematical expressions, powers, ചില footnote references തുടങ്ങിയവയിൽ ഇത് ഉപയോഗിക്കാം.
<p>2<sup>3</sup> = 8</p> <p>x<sup>2</sup> + y<sup>2</sup></p>
<code> — Code Text
ഒരു ചെറിയ computer code ഭാഗം text-ന്റെ ഉള്ളിൽ കാണിക്കുമ്പോൾ <code> ഉപയോഗിക്കാം. Browser സാധാരണയായി ഇത് monospace font-ൽ കാണിക്കും.
<p>Use the <code>print()</code> function to display output.</p>
ഇവിടെ print() ഒരു programming code ഭാഗമാണെന്ന് <code> വ്യക്തമാക്കുന്നു. Python, JavaScript തുടങ്ങിയ programming languages-ന്റെ ചെറിയ code examples document-ൽ കാണിക്കുമ്പോൾ ഇത് ഉപയോഗപ്രദമാണ്.
<pre> — Preformatted Text
Spaces, line breaks എന്നിവയുടെ രൂപം browser-ൽ അതേപടി നിലനിർത്തേണ്ട text-നായി <pre> ഉപയോഗിക്കാം. Code അല്ലെങ്കിൽ preformatted text കാണിക്കാൻ ഇത് ഉപയോഗപ്രദമാണ്.
<pre> Name: Anu Age: 25 Course: HTML </pre>
<pre>-ന്റെ ഉള്ളിലെ whitespace-ഉം line breaks-ഉം browser സാധാരണയായി preserve ചെയ്യും. <code> -നൊപ്പം ഉപയോഗിക്കുമ്പോൾ code blocks കാണിക്കാനും ഇത് സഹായിക്കും.
<blockquote> — Quotation
മറ്റൊരു വ്യക്തിയിൽ നിന്നോ source-ൽ നിന്നോ എടുത്ത ഒരു വലിയ quotation അല്ലെങ്കിൽ quoted section സൂചിപ്പിക്കാൻ <blockquote> ഉപയോഗിക്കാം.
<blockquote> The web is for everyone. </blockquote>
വലിയ quoted content-നാണ് സാധാരണയായി <blockquote> ഉപയോഗിക്കുന്നത്. ചെറിയ quotation text-നായി <q> ഉപയോഗിക്കാം.
<q> — ചെറിയ Quotation
ഒരു paragraph-ന്റെ ഉള്ളിൽ ചെറിയ quotation ഉൾപ്പെടുത്താൻ <q> ഉപയോഗിക്കാം. Browser സാധാരണയായി quotation marks ചേർത്ത് കാണിക്കും.
<p>My teacher said, <q>Practice makes progress.</q></p>
<abbr> — Abbreviation
ഒരു abbreviation അല്ലെങ്കിൽ acronym-ന്റെ full meaning നൽകാൻ ഉപയോഗിക്കാം. title attribute ഉപയോഗിച്ച് അതിന്റെ വിശദീകരണം നൽകാം.
<p><abbr title="HyperText Markup Language">HTML</abbr> is used to structure webpages.</p>
ഇവിടെ HTML എന്ന abbreviation-ന്റെ full form title attribute-ൽ നൽകിയിരിക്കുന്നു. User സാധാരണയായി abbreviation-ന് മുകളിൽ mouse കൊണ്ടുവരുമ്പോൾ browser അത് tooltip ആയി കാണിക്കാം.
<cite> — Work Title
ഒരു creative work-ന്റെ title സൂചിപ്പിക്കാൻ <cite> ഉപയോഗിക്കാം. ഉദാഹരണത്തിന് ഒരു book, research paper, movie അല്ലെങ്കിൽ മറ്റൊരു work-ന്റെ പേര്.
<p>I am reading <cite>Introduction to Web Development</cite>.</p>
<time> — Date and Time
ഒരു date അല്ലെങ്കിൽ time machine-readable രീതിയിൽ mark ചെയ്യാൻ <time> ഉപയോഗിക്കാം. datetime attribute ഉപയോഗിച്ച് കൂടുതൽ വ്യക്തമായ date/time value നൽകാം.
<p>The course starts on <time datetime="2026-10-01">October 1, 2026</time>.</p>
ഇവിടെ user-ന് October 1, 2026 എന്ന text കാണാം. datetime attribute-ൽ date-ന്റെ standardized value നൽകിയിരിക്കുന്നു.
Text Formatting Elements — ഒരു നോക്കിൽ
| Element | പ്രധാന ഉപയോഗം |
|---|---|
| <strong> | പ്രധാനപ്പെട്ട content |
| <em> | Emphasis നൽകാൻ |
| <b> | Bold appearance നൽകാൻ |
| <i> | Italic appearance അല്ലെങ്കിൽ പ്രത്യേക text |
| <u> | Underline annotation |
| <mark> | Highlight ചെയ്യാൻ |
| <small> | ചെറിയ supplementary text |
| <del> | Deleted content |
| <ins> | Inserted content |
| <s> | ഇനി ശരിയല്ലാത്ത അല്ലെങ്കിൽ relevant അല്ലാത്ത content |
| <sub> | Subscript text |
| <sup> | Superscript text |
| <code> | ചെറിയ code ഭാഗം |
| <pre> | Preformatted text |
| <blockquote> | വലിയ quotation |
| <q> | ചെറിയ quotation |
| <abbr> | Abbreviation |
| <cite> | Creative work-ന്റെ title |
| <time> | Date അല്ലെങ്കിൽ time |
Semantic Formatting vs Visual Formatting
HTML-ൽ text formatting പഠിക്കുമ്പോൾ ഒരു പ്രധാന കാര്യം ഓർക്കണം: ഒരു text എങ്ങനെ കാണുന്നു എന്നതും അത് എന്താണ് അർത്ഥമാക്കുന്നത് എന്നതും ഒരേ കാര്യമല്ല. <strong> important content എന്നാണ് സൂചിപ്പിക്കുന്നത്. <em> emphasis എന്നാണ് സൂചിപ്പിക്കുന്നത്. അതേസമയം <b> അല്ലെങ്കിൽ <i> പല സാഹചര്യങ്ങളിലും appearance അല്ലെങ്കിൽ പ്രത്യേക text-നെ വേർതിരിക്കാൻ ഉപയോഗിക്കാം.
<p><strong>Important:</strong> Submit your assignment today.</p> <p><em>Please</em> read the instructions carefully.</p> <p><b>HTML</b> is a markup language.</p>
CSS പഠിക്കുമ്പോൾ text-ന്റെ നിറം, വലുപ്പം, font, spacing തുടങ്ങിയ appearance മാറ്റാൻ പഠിക്കും. അതിനാൽ HTML elements തിരഞ്ഞെടുക്കുമ്പോൾ കഴിയുന്നത്ര content-ന്റെ meaning പരിഗണിക്കുക.
ഒന്നിലധികം Formatting Elements ഒരുമിച്ച്
ആവശ്യമായപ്പോൾ ഒരു text-ന്റെ ഉള്ളിൽ ഒന്നിലധികം HTML elements ഉപയോഗിക്കാം. എന്നാൽ structure വ്യക്തമായിരിക്കണം.
<p><strong><em>Important:</em></strong> Practice HTML every day.</p> <p>Water is H<sub>2</sub>O.</p> <p>The value is 10<sup>2</sup>.</p>
ഇവിടെ <strong>-ന്റെ ഉള്ളിൽ <em> ഉപയോഗിച്ചിട്ടുണ്ട്. രണ്ടാമത്തെ paragraph-ൽ <sub>യും മൂന്നാമത്തേതിൽ <sup>യും ഉപയോഗിച്ചിട്ടുണ്ട്.
Text Formatting ഉപയോഗിച്ചുള്ള ഒരു Complete Example
ഇപ്പോൾ വിവിധ text formatting elements ഒരു ചെറിയ article-ൽ ഉപയോഗിക്കാം.
<h1>Learning HTML</h1> <p><strong>HTML</strong> is a <em>markup language</em> used to structure webpages.</p> <p>For example, use <code><h1></code> for a main heading.</p> <p>Water is H<sub>2</sub>O and 2<sup>3</sup> equals 8.</p> <p><mark>Practice is important</mark> when learning HTML.</p> <blockquote> Good structure makes webpages easier to understand. </blockquote>
ഈ example-ൽ heading, paragraph, strong, emphasis, code, subscript, superscript, highlight, quotation തുടങ്ങിയ elements ഒരേ webpage-ൽ എങ്ങനെ ഉപയോഗിക്കാമെന്ന് കാണാം.
ഒരു പ്രധാന Code കാര്യം
HTML code തന്നെ webpage-ൽ text ആയി കാണിക്കുമ്പോൾ < , > പോലുള്ള characters browser-ന് tag ആയി തോന്നാം. അതിനാൽ പിന്നീട് code examples webpage-ൽ പ്രദർശിപ്പിക്കുമ്പോൾ HTML entities പോലുള്ള രീതികൾ ഉപയോഗിക്കേണ്ടി വരും. ഇപ്പോൾ ഈ ആശയം മാത്രം ഓർക്കുക.
<p>The HTML element is written as <p>.</p>
ഇവിടെ < ഉപയോഗിച്ച് <-ഉം > ഉപയോഗിച്ച് >-ഉം text ആയി browser-ൽ കാണിക്കുന്നു. Entities-നെക്കുറിച്ച് പിന്നീട് ആവശ്യമായിടത്ത് കൂടുതൽ പഠിക്കാം.
സാധാരണ തുടക്കക്കാരുടെ തെറ്റുകൾ
- എല്ലാ bold text-നും
<strong>ഉപയോഗിക്കുകയും അതിന്റെ semantic meaning പരിഗണിക്കാതിരിക്കുകയും ചെയ്യുന്നു - എല്ലാ italic text-നും
<em>ഉപയോഗിക്കുന്നു, പക്ഷേ emphasis ആവശ്യമാണോ എന്ന് നോക്കുന്നില്ല - Text വലുതാക്കാനോ bold ആക്കാനോ HTML elements തെറ്റായി ഉപയോഗിക്കുന്നു
- Deleted content-നും ഇനി valid അല്ലാത്ത content-നും
<del>യും<s>യും തമ്മിലുള്ള വ്യത്യാസം മനസ്സിലാക്കാതെ ഉപയോഗിക്കുന്നു <br>ഉപയോഗിച്ച് text formatting ചെയ്യാൻ ശ്രമിക്കുന്നു- Code text-ന്
<code>ഉപയോഗിക്കാതെ സാധാരണ paragraph-ൽ എഴുതുന്നു <blockquote<ചെറിയ quotation-കൾക്കായി ഉപയോഗിക്കുന്നു- Subscript, superscript എന്നിവ ആവശ്യമുള്ള mathematical അല്ലെങ്കിൽ scientific content-ൽ ഉപയോഗിക്കാതെ plain text മാത്രം ഉപയോഗിക്കുന്നു
ഈ അധ്യായത്തിന്റെ സംഗ്രഹം
- HTML text formatting elements ഉപയോഗിച്ച് content-ന് കൂടുതൽ meaning നൽകുന്നത് പഠിച്ചു
<strong>ഉപയോഗിച്ച് important content വ്യക്തമാക്കുന്നത് പഠിച്ചു<em>ഉപയോഗിച്ച് emphasis നൽകുന്നത് പഠിച്ചു<b>യും<i>യും എപ്പോൾ ഉപയോഗിക്കാമെന്ന് മനസ്സിലാക്കി<mark>,<small>,<del>,<ins>,<s>എന്നിവ പരിചയപ്പെട്ടു<sub>യും<sup>യും ഉപയോഗിച്ച് subscript, superscript text എഴുതുന്നത് പഠിച്ചു<code>യും<pre>യും code, preformatted text എന്നിവയ്ക്കായി ഉപയോഗിക്കുന്നത് പഠിച്ചു<blockquote>യും<q>യും quotations-നായി ഉപയോഗിക്കുന്നത് പഠിച്ചു<abbr>,<cite>,<time>എന്നിവയുടെ ഉപയോഗം പരിചയപ്പെട്ടു- Semantic meaning-നും visual appearance-നും തമ്മിലുള്ള വ്യത്യാസം മനസ്സിലാക്കി
വ്യായാമങ്ങൾ
<strong>ഉപയോഗിച്ച് ഒരു പ്രധാന മുന്നറിയിപ്പ് message എഴുതുക<em>ഉപയോഗിച്ച് emphasis നൽകുന്ന മൂന്ന് sentences എഴുതുക<mark>ഉപയോഗിച്ച് ഒരു paragraph-ലെ പ്രധാനപ്പെട്ട വാക്കുകൾ highlight ചെയ്യുക- ഒരു പഴയ വില
<del>ഉപയോഗിച്ചും പുതിയ വിലഉപയോഗിച്ചും കാണിക്കുക - H₂O, CO₂ എന്നീ chemical formulas
<sub>ഉപയോഗിച്ച് എഴുതുക - 2³, x² എന്നിവ
<sup>ഉപയോഗിച്ച് എഴുതുക <code>ഉപയോഗിച്ച് ഒരു ചെറിയ Python അല്ലെങ്കിൽ HTML code ഭാഗം paragraph-ൽ കാണിക്കുക<blockquote>ഉപയോഗിച്ച് ഒരു quotation ചേർക്കുക<abbr>ഉപയോഗിച്ച് HTML-ന്റെ full form tooltip ആയി നൽകുക<time>ഉപയോഗിച്ച് ഒരു date webpage-ൽ mark ചെയ്യുക
Quiz & Self Assessment
അടുത്ത അധ്യായത്തിൽ, ഒരു webpage-ൽ നിന്ന് മറ്റൊരു webpage-ലേക്കും page-ന്റെ വിവിധ ഭാഗങ്ങളിലേക്കും എങ്ങനെ പോകാം എന്ന് പഠിക്കും. അതിനായി HTML-യിലെ ഏറ്റവും പ്രധാനപ്പെട്ട elements-ൽ ഒന്നായ links (<a>) പരിചയപ്പെടാം.