Chapter 010m

HTML Introduction in Gujarati

ગુજરાતીમાં HTML Introduction શીખો. HTML Elements, Tags, Basic Structure, Code Examples, MCQ અને Practice Exercises સાથે HTML શીખવાની શરૂઆત કરો.

W3PrimeCode ના પ્રથમ HTML Chapter માં આપનું સ્વાગત છે!

HTML એ Web Development નો પાયો છે. જો તમે તમારી પોતાની Website બનાવવા માંગતા હો અથવા Frontend Developer બનવા માંગતા હો, તો HTML સમજવું એ એક મહત્વપૂર્ણ પ્રથમ પગલું છે.

આ Chapter માં તમે HTML શું છે, તે કેવી રીતે કામ કરે છે અને Basic HTML Document કેવી રીતે બનાવવામાં આવે છે તે શીખશો.

HTML શું છે?

HTML નું પૂરું નામ HyperText Markup Language છે.

HTML એક Standard Markup Language છે, જેનો ઉપયોગ Web Page ના Content નું Structure અને અર્થ નક્કી કરવા માટે થાય છે.

  • HTML Web Page નું Structure બનાવે છે.
  • HTML માં Elements અને Tags દ્વારા Content ગોઠવવામાં આવે છે.
  • HTML Browser ને Content ની રચના અને અર્થ સમજવામાં મદદ કરે છે.
  • Web Browser HTML Document ને Interpret કરે છે.
  • Modern Websites માટે HTML સાથે CSS અને JavaScript નો ઉપયોગ થાય છે.

મહત્વપૂર્ણ: HTML એ General-purpose Programming Language નથી. તે એક Markup Language છે.

HTML Element શું છે?

HTML Element એ Web Page નો એક ચોક્કસ ભાગ છે, જેમ કે Heading, Paragraph અથવા Link.

મોટાભાગના HTML Elements માં ત્રણ ભાગ હોય છે:

  1. Start Tag
  2. Content
  3. End Tag

Basic Syntax:

html
<tagname>Content goes here</tagname>

Example:

html
<h1>My First Heading</h1>
<p>My First Paragraph.</p>

Code Explanation:

  • <h1> એ Heading નો Start Tag છે.
  • My First Heading તેનો Content છે.
  • </h1> એ End Tag છે.
  • <p> Paragraph દર્શાવે છે.
  • </p> Paragraph Element બંધ કરે છે.

બધા HTML Elements માટે End Tag જરૂરી નથી. આગળના Chapters માં Void Elements વિશે શીખશો.

તમારું પ્રથમ HTML Document

ચાલો, એક સરળ HTML Page બનાવીએ.

Example:

html
<!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કાર્ય
\<!DOCTYPE html>Document HTML5 નો ઉપયોગ કરે છે તેવી જાહેરાત કરે છે.
\<html>HTML Document નું Root Element છે.
\<head>Document ની Metadata ધરાવે છે.
\<title>Browser Tab નું Title નક્કી કરે છે.
\<body>Visible Page Content ધરાવે છે.
\<h1>Top-level Heading બનાવે છે.
\<p>Paragraph બનાવે છે.

HTML કેવી રીતે કામ કરે છે?

Browser માં Web Page ખોલવામાં આવે ત્યારે સામાન્ય રીતે:

  1. Browser HTML Document મેળવે છે.
  2. HTML ને Parse કરીને Document Object Model (DOM) બનાવે છે.
  3. Document Structure, Styling અને જરૂરી Resources ના આધારે Page Render થાય છે.
  4. Screen પર Web Page દેખાય છે.

Example:

html
<h1>Learn HTML</h1>
<p>HTML is easy to start learning.</p>

HTML, CSS અને JavaScript વચ્ચેનો તફાવત

Technologyમુખ્ય કાર્ય
HTMLContent નું Structure અને અર્થ નક્કી કરવું
CSSAppearance અને Layout નિયંત્રિત કરવું
JavaScriptInteractivity અને Dynamic Behavior ઉમેરવું

ઉદાહરણ તરીકે, HTML દ્વારા Button બનાવી શકાય છે, CSS દ્વારા તેની Design બદલી શકાય છે અને JavaScript દ્વારા Click કર્યા પછી શું થવું જોઈએ તે નક્કી કરી શકાય છે.

Important Points

  • HTML નું પૂરું નામ HyperText Markup Language છે.
  • HTML એક Markup Language છે.
  • HTML File સામાન્ય રીતે .html Extension વાપરે છે.
  • <body> માં Visible Content હોય છે.
  • <head> માં Document Metadata હોય છે.
  • Browser HTML ને Interpret કરીને Web Page દર્શાવે છે.
  • HTML Tags સામાન્ય રીતે Case-insensitive હોય છે, પરંતુ Lowercase વાપરવું Recommended છે.

Common Beginner Mistakes

Mistake 1: End Tag લખવાનું ભૂલી જવું

Incorrect:

html
<h1>Welcome
<p>Learn HTML</p>

Correct:

html
<h1>Welcome</h1>
<p>Learn HTML</p>

**Mistake 2: Visible Content ને <head> માં લખવું**

Incorrect:

html
<head>
    <h1>Welcome</h1>
</head>

Correct:

html
<head>
    <title>My Website</title>
</head>
<body>
    <h1>Welcome</h1>
</body>

Mistake 3: ખોટું File Extension

HTML Document ને index.html નામથી Save કરો, index.txt નામથી નહીં.

Practical Use Case

ધારો કે તમે તમારું Personal Introduction Page બનાવવા માંગો છો.

html
<!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>

આ Example માં HTML દ્વારા એક સરળ Personal Web Page નું Content ગોઠવવામાં આવ્યું છે.

Try It Yourself

નીચેનો Code બદલીને તમારું પોતાનું Introduction Page બનાવો.

html
<!DOCTYPE html>
<html>
<head>
    <title>My Introduction</title>
</head>
<body>
    <h1>Your Name</h1>
    <p>Write something about yourself.</p>
</body>
</html>

તમારું Task:

  1. Your Name ની જગ્યાએ તમારું નામ લખો.
  2. Paragraph માં તમારા વિશે એક વાક્ય લખો.
  3. Browser Tab નું Title બદલો.
  4. Code Run કરીને Output જુઓ.

Practice Exercises

Exercise 1 — Easy: HTML નું પૂરું નામ શું છે?

Exercise 2 — Easy: Web Page નું Visible Content કયા Element માં હોય છે?

Exercise 3 — Medium: Welcome to HTML લખાણ માટે Heading બનાવો.

Exercise 4 — Medium: I am learning HTML લખાણ માટે Paragraph બનાવો.

Exercise 5 — Challenge: Title, એક Heading અને બે Paragraphs ધરાવતું સંપૂર્ણ HTML Document બનાવો.