Gabatarwa zuwa Tsarin HTML: Mahimman Abubuwa da Haɗin kai

Tsarin HTML yana taka muhimmiyar rawa wajen gina shafukan yanar gizo. Yana bayyana yadda aka tsara abun ciki da nunawa akan shafin yanar gizon. Anan ga gabatarwa ga ainihin tsarin HTML:

1. Doctype

Doctype(Sanarwa Nau'in Takardu) yana bayyana sigar HTML ɗin da shafin yanar gizon ke amfani da shi. Ya kamata a sanya shi a farkon fayil ɗin HTML.

2. html tag

html tag shine tushen tushen kowane fayil na HTML. Yana tattara dukkan abubuwan da ke cikin shafin yanar gizon.

3. head Tag

Tambarin kai ya ƙunshi bayanai game da shafin yanar gizon da ba a nuna kai tsaye a kan mai lilo ba. Anan ne aka ayyana taken shafin, meta tags, hanyoyin haɗi zuwa fayilolin CSS da JavaScript, da sauran abubuwa daban-daban.

4. body Tag

Tambarin jiki ya ƙunshi duk abubuwan da aka nuna akan shafin yanar gizon. Wannan shine inda aka ayyana abubuwa kamar rubutu, hotuna, bidiyo, hanyoyin haɗin gwiwa, da sauran abubuwan haɗin haɗin mai amfani.

5. Tags

HTML yana amfani da tsari mai matsayi tare da alamun buɗewa da rufewa. Ana sanya alamun yara a cikin alamun iyaye. Misali, alamar p(sakin layi) na iya ƙunsar tags(rubutun layi), tags masu ƙarfi(rubutu masu ƙarfi), da sauran alamun da yawa.

6. Common tags

HTML yana ba da kewayon alamomi don tsarawa da nuna abun ciki. Misali, alamun h1-h6(kantunan), p tag(sakin layi), tag img(hoto), tag(mahaɗi), da sauran su.

 

Ga misalin cikakken tsarin shafin HTML:

<!DOCTYPE html>  
<html lang="en">  
<head>  
    <meta charset="UTF-8">  
    <meta name="viewport" content="width=device-width, initial-scale=1.0">  
    <title>My Webpage</title>  
    <link rel="stylesheet" href="styles.css">  
    <script src="script.js"></script>  
</head>  
<body>  
    <header>  
        <h1>Welcome to My Webpage</h1>  
        <nav>  
            <ul>  
                <li><a href="#">Home</a></li>  
                <li><a href="#">About</a></li>  
                <li><a href="#">Contact</a></li>  
            </ul>  
        </nav>  
    </header>  
    <main>  
        <section>  
            <h2>About Me</h2>  
            <p>I am a web developer passionate about creating amazing websites.</p>  
        </section>  
        <section>  
            <h2>My Projects</h2>  
            <ul>  
                <li><a href="#">Project 1</a></li>  
                <li><a href="#">Project 2</a></li>  
                <li><a href="#">Project 3</a></li>  
            </ul>  
        </section>  
    </main>  
    <footer>  
        <p>&copy; 2022 My Webpage. All rights reserved.</p>  
    </footer>  
</body>  
</html>  

A cikin misalin da ke sama, muna da cikakken shafin HTML tare da manyan abubuwa kamar doctype, html tag, head tag da body tag. A cikin sashin kai, muna ayyana taken shafi, fayilolin CSS da JavaScript da za a yi amfani da su. Sashen jiki ya ƙunshi abubuwa kamar kai, babba, da ƙafa don nuna abun ciki na shafin yanar gizon.

 

Ta amfani da madaidaicin tsarin HTML, zaku iya gina ingantaccen tsarin, karantawa, da shafukan yanar gizo masu mu'amala.