HTML Introduction
HTML എന്താണെന്നും, HTML Elements എങ്ങനെ പ്രവർത്തിക്കുന്നുവെന്നും, ലളിതമായ ഉദാഹരണങ്ങളും പരിശീലനങ്ങളും ഉപയോഗിച്ച് നിങ്ങളുടെ ആദ്യ HTML Document എങ്ങനെ സൃഷ്ടിക്കാമെന്നും പഠിക്കാം.
W3PrimeCode HTML Tutorial-ന്റെ ആദ്യ അധ്യായത്തിലേക്ക് സ്വാഗതം!
HTML വെബ് ഡെവലപ്മെന്റിന്റെ അടിത്തറയാണ്. വ്യക്തിഗത വെബ്സൈറ്റ് ഉണ്ടാക്കണോ, ബ്ലോഗ് നിർമ്മിക്കണോ, അല്ലെങ്കിൽ Frontend Developer ആകണോ – HTML മനസ്സിലാക്കുക എന്നത് അനിവാര്യമായ ആദ്യ ഘട്ടമാണ്.
ഈ അധ്യായത്തിൽ നിങ്ങൾ HTML എന്താണെന്നും, അത് എങ്ങനെ പ്രവർത്തിക്കുന്നുവെന്നും, ഒരു അടിസ്ഥാന HTML Document എങ്ങനെ ഘടിപ്പിച്ചിരിക്കുന്നുവെന്നും പഠിക്കും.
What is HTML?
HTML എന്നാൽ HyperText Markup Language.
HTML വെബ് പേജുകൾ സൃഷ്ടിക്കാനും ഘടിപ്പിക്കാനും ഉപയോഗിക്കുന്ന standard Markup Language ആണ്.
- HTML വെബ് ഉള്ളടക്കത്തിന്റെ ഘടനയും അർത്ഥവും വിവരിക്കുന്നു.
- HTML ഉള്ളടക്കം ക്രമീകരിക്കാൻ Elements-ഉം Tags-ഉം ഉപയോഗിക്കുന്നു.
- HTML Browser-നോട് ഉള്ളടക്കം എങ്ങനെ ക്രമീകരിച്ചിരിക്കുന്നുവെന്ന് പറയുന്നു.
- HTML Documents Web Browsers വ്യാഖ്യാനിക്കുന്നു.
- ആധുനിക വെബ്സൈറ്റുകൾ സൃഷ്ടിക്കാൻ HTML, CSS, JavaScript എന്നിവയോടൊപ്പം പ്രവർത്തിക്കുന്നു.
HTML ഒരു Programming Language അല്ല. അത് ഒരു Markup Language ആണ്, കാരണം അത് general-purpose programming logic നൽകുന്നതിന് പകരം Tags ഉപയോഗിച്ച് ഉള്ളടക്കം വിവരിക്കുന്നു.
What is an HTML Element?
ഒരു HTML Element ഒരു Web Page-ന്റെ ഒരു ഭാഗത്തെ പ്രതിനിധീകരിക്കുന്നു – ഉദാഹരണത്തിന് Heading, Paragraph, അല്ലെങ്കിൽ Link.
മിക്ക HTML Elements-നും Start Tag, Content, End Tag എന്നിവ ഉണ്ട്.
Basic Syntax:
<tagname>Content goes here</tagname>Example:
<h1>My First Heading</h1>
<p>My First Paragraph.</p>Explanation:
- \<h1> ഒരു Heading Element-ന്റെ Start Tag ആണ്.
- My First Heading അതിന്റെ Content ആണ്.
- \</h1> End Tag ആണ്.
- \<p> ഒരു Paragraph നിർവചിക്കുന്നു.
- \</p> Paragraph Element അടയ്ക്കുന്നു.
Note: എല്ലാ HTML Element-നും End Tag ആവശ്യമില്ല. Void Elements കുറിച്ച് പിന്നീടുള്ള അധ്യായങ്ങളിൽ പഠിക്കാം.
Your First HTML Document
ഒരു ലളിതമായ HTML Page ഉണ്ടാക്കാം.
Example:
<!DOCTYPE html>
<html>
<head>
<title>My First HTML Page</title>
</head>
<body>
<h1>Hello, World!</h1>
<p>Welcome to W3PrimeCode.</p>
</body>
</html>Example Explained
| Code | Explanation |
|---|---|
| \<!DOCTYPE html> | Document HTML5 ഉപയോഗിക്കുന്നുവെന്ന് പ്രഖ്യാപിക്കുന്നു. |
| \<html> | HTML Document-ന്റെ Root Element ആണ്. |
| \<head> | Document Metadata അടങ്ങിയിരിക്കുന്നു. |
| \<title> | Browser Tab-ൽ കാണിക്കുന്ന title നിർണ്ണയിക്കുന്നു. |
| \<body> | ദൃശ്യമായ page content അടങ്ങിയിരിക്കുന്നു. |
| \<h1> | top-level Heading നിർവചിക്കുന്നു. |
| \<p> | Paragraph നിർവചിക്കുന്നു. |
Browser HTML Document വായിച്ച്, അതിന്റെ Elements വ്യാഖ്യാനിച്ച്, page render ചെയ്യുന്നു.
How Does HTML Work?
നിങ്ങൾ ഒരു Web Page തുറക്കുമ്പോൾ സാധാരണയായി ഈ പ്രക്രിയ നടക്കുന്നു:
- Browser ഒരു HTML Document സ്വീകരിക്കുന്നു.
- അത് HTML parse ചെയ്ത് Document Object Model (DOM) നിർമ്മിക്കുന്നു.
- Document structure, styling, മറ്റ് resources ഉപയോഗിച്ച് Web Page render ചെയ്യുന്നു.
- ഫലമായുള്ള content നിങ്ങളുടെ സ്ക്രീനിൽ പ്രത്യക്ഷപ്പെടുന്നു.
For example:
<h1>Learn HTML</h1>
<p>HTML is easy to start learning.</p>HTML, CSS, and JavaScript
ഈ മൂന്ന് technologies-നും വ്യത്യസ്ത ഉത്തരവാദിത്തങ്ങളുണ്ട്.
| Technology | Purpose |
|---|---|
| HTML | ഉള്ളടക്കത്തിന്റെ ഘടനയും അർത്ഥവും നിർവചിക്കുന്നു. |
| CSS | രൂപഭാവവും layout-ഉം നിയന്ത്രിക്കുന്നു. |
| JavaScript | interactivity-യും dynamic behavior-ഉം ചേർക്കുന്നു. |
ഉദാഹരണത്തിന്, HTML ഒരു Button സൃഷ്ടിക്കുന്നു, CSS അതിന്റെ രൂപഭാവം മാറ്റാം, JavaScript അതിൽ ക്ലിക്ക് ചെയ്യുമ്പോൾ എന്ത് സംഭവിക്കണമെന്ന് നിർവചിക്കാം.
Important Points to Remember
- HTML എന്നാൽ HyperText Markup Language.
- HTML ഒരു Markup Language ആണ്, general-purpose Programming Language അല്ല.
- HTML Documents സാധാരണയായി .html extension ഉപയോഗിക്കുന്നു.
- \<body> Element-ൽ ദൃശ്യമായ page content ഉണ്ട്.
- \<head> Element-ൽ document Metadata ഉണ്ട്.
- Browsers HTML വ്യാഖ്യാനിച്ച് Web Pages പ്രദർശിപ്പിക്കുന്നു.
- HTML Tags സാധാരണയായി case-insensitive ആണ്, പക്ഷേ consistency-ക്കായി lowercase ശുപാർശ ചെയ്യുന്നു.
- HTML ഘടന നിർവചിക്കുന്നു; CSS-ഉം JavaScript-ഉം വ്യത്യസ്ത ആവശ്യങ്ങൾക്കാണ്.
Common Beginner Mistakes
Mistake 1: Forgetting an End Tag
Incorrect:
<h1>Welcome
<p>Learn HTML</p>Correct:
<h1>Welcome</h1>
<p>Learn HTML</p>Mistake 2: Placing Visible Content Inside \<head>
Incorrect:
<head>
<h1>Welcome</h1>
</head>Correct:
<head>
<title>My Website</title>
</head>
<body>
<h1>Welcome</h1>
</body>Mistake 3: Saving a File with the Wrong Extension
നിങ്ങളുടെ HTML Document index.html ആയി save ചെയ്യുക, index.txt അല്ല.
Practical Use Case
വ്യക്തിഗത introduction page ഉണ്ടാക്കണമെന്ന് സങ്കൽപ്പിക്കുക.
<!DOCTYPE html>
<html>
<head>
<title>About Me</title>
</head>
<body>
<h1>My Name is Alex</h1>
<p>I am learning Web Development.</p>
<p>This is my first HTML project.</p>
</body>
</html>ഈ ഉദാഹരണം HTML എങ്ങനെ ലളിതമായ personal Web Page-ൽ വിവരങ്ങൾ ക്രമീകരിക്കുന്നുവെന്ന് കാണിക്കുന്നു.
Try It Yourself
താഴെയുള്ള code മാറ്റി നിങ്ങളുടെ പേരും ചെറിയ introduction-ഉം പ്രദർശിപ്പിക്കുക.
<!DOCTYPE html>
<html>
<head>
<title>My Introduction</title>
</head>
<body>
<h1>Your Name</h1>
<p>Write something about yourself.</p>
</body>
</html>Your Task:
- Your Name നിങ്ങളുടെ പേര് ഉപയോഗിച്ച് മാറ്റുക.
- നിങ്ങളെക്കുറിച്ച് ഒരു വാക്യം എഴുതുക.
- Browser Tab title മാറ്റുക.
- Code run ചെയ്ത് ഫലം നിരീക്ഷിക്കുക.
Practice Exercises
Exercise 1 — Easy: HTML എന്തിനെ സൂചിപ്പിക്കുന്നു? Exercise 2 — Easy: Web Page-ന്റെ ദൃശ്യമായ content ഏത് HTML Element-ൽ അടങ്ങിയിരിക്കുന്നു? Exercise 3 — Medium: Welcome to HTML എന്ന text ഉള്ള ഒരു HTML Heading എഴുതുക. Exercise 4 — Medium: I am learning HTML എന്ന text ഉള്ള ഒരു Paragraph ഉണ്ടാക്കുക. Exercise 5 — Challenge: Title, Heading, രണ്ട് Paragraphs ഉള്ള ഒരു പൂർണ്ണ HTML Document ഉണ്ടാക്കുക.