ู…ู‚ุฏู…ุฉ: ุงู„ู…ุนู†ู‰ ุฃู‡ู… ู…ู† ุงู„ุดูƒู„

  • ุงู„ููƒุฑุฉ ุจุจุณุงุทุฉ ุฅู† ููŠู‡ ุนู†ุงุตุฑ HTML ู…ุนูŠู†ุฉ ุจูŠูƒูˆู† ู„ูŠู‡ุง ู…ุนู†ู‰ ุฃูˆ ู‡ุฏู ู…ุนูŠู† ู…ุชุตู„ ุจูŠู‡ุง.
  • ูŠุนู†ูŠ ู„ู…ุง ู†ููƒุฑ ููŠ ุนู†ุตุฑ HTML ู…ุนูŠู†ุŒ ุงู„ู…ูุฑูˆุถ ู…ู†ุจู‚ุงุด ุจู†ููƒุฑ ุดูƒู„ู‡ ุนุงู…ู„ ุฅุฒุงูŠ ุนู„ู‰ ุงู„ุตูุญุฉุŒ ู„ุฃุŒ ุงู„ู…ูุฑูˆุถ ู†ููƒุฑ ุงู„ุนู†ุตุฑ ุฏู‡ ู…ุนู†ุงู‡ ุฅูŠู‡ ูˆุจูŠู…ุซู„ ุฅูŠู‡ ุจุงู„ุธุจุท.
  • ู…ุด ูƒู„ ุงู„ุนู†ุงุตุฑ ููŠ HTML ู„ูŠู‡ุง ู…ุนู†ู‰ (semantic).
    • ุงุชูƒู„ู…ู†ุง ุนู†ู‡ุง ู‚ุจู„ ูƒุฏู‡ ููŠ Bold ูˆ Italic.
    • ูˆุงุชูƒู„ู…ู†ุง ุนู†ู‡ุง ููŠ Structuring the page HTML.
    • ู…ุซู„ุงู‹ุŒ ุงู„ู€ <nav> ูƒู„ ูˆุธูŠูุชู‡ ุฅู†ู‡ ูŠูˆุถุญ ุฅู† ุฏู‡ ุฌุฒุก ุงู„ู€ navigation.

ู†ูุณ ุงู„ูƒู„ุงู… ูŠู†ุทุจู‚ ุนู„ู‰ ุงู„ู€ paragraphs. ุงู„ู€ paragraph ุนุจุงุฑุฉ ุนู† ุตู†ุฏูˆู‚ ุจูŠุดูŠู„ ูƒู„ุงู…ุŒ ุจุณ ู„ูŠู‡ ู…ุนู†ู‰ ุฅู†ู‡ ูู‚ุฑุฉ. ู…ู…ูƒู† ู†ุณุชุจุฏู„ู‡ ู…ุซู„ุงู‹ ุจู€ divุŒ ุจุณ ููŠ ุงู„ุญุงู„ุฉ ุฏูŠุŒ ู…ุด ู‡ูŠูƒูˆู† ู„ูŠู‡ ุฃูŠ ู…ุนู†ู‰.

ู„ูŠู‡ ุงู„ู€ Semantic HTML ู…ู‡ู…ุŸ

ุงุณุชุฎุฏุงู… ุงู„ุนู†ุงุตุฑ ุฏูŠ ุจู…ุนู†ุงู‡ุง ุงู„ุตุญ ู…ู‡ู… ุนุดุงู†:

  • ู…ุญุฑูƒุงุช ุงู„ุจุญุซ (Search Engines): ุจุชู‚ุฏุฑ ุชูู‡ู… ู‡ูŠูƒู„ ุงู„ู…ุญุชูˆู‰ ุจุชุงุนูƒ ุจุดูƒู„ ุฃูุถู„.
  • ุงู„ู€ Accessibility: ุจุชุณุงุนุฏ ุงู„ู†ุงุณ ุงู„ู„ูŠ ุจุชุนุชู…ุฏ ุนู„ู‰ screen readers ุนุดุงู† ูŠูู‡ู…ูˆุง ูˆูŠู‚ุฑูˆุง ุตูุญุงุช ุงู„ูˆูŠุจ ุจุชุงุนุชู†ุง.

ุฅุฒุงูŠ ู†ูˆุตู ู…ุนู†ู‰ ุตูุญุฉ ุงู„ูˆูŠุจุŸ (ุงู„ุฃุณุงู†ุณูŠุฑ ูƒู…ุซุงู„)

ู„ุญุฏ ุฏู„ูˆู‚ุชูŠ ุฅู†ุช ุนุงุฑู ุฅู† ุงู„ู€ HTML ุจูŠูˆุตู ู…ุญุชูˆู‰ ุตูุญุฉ ุงู„ูˆูŠุจ. ุจุณ ุฅุฒุงูŠ ุชูˆุตู ู…ุนู†ู‰ ุงู„ุตูุญุฉ ุฏูŠุŸ

ุนุดุงู† ู†ูู‡ู… ุฏู‡ ููŠ ุณูŠุงู‚ ูˆุงู‚ุนูŠุŒ ููƒุฑ ููŠ ุฒุฑุงูŠุฑ ุงู„ุฃุณุงู†ุณูŠุฑ. ู…ุฌุฑุฏ ุชุฑุชูŠุจ ุงู„ุฒุฑุงูŠุฑ ุจุดูƒู„ ุฑุฃุณูŠ ู…ุด ูƒูุงูŠุฉ ุนุดุงู† ุญุฏ ูŠูู‡ู… ู…ุนู†ุงู‡ุง. ุนุดุงู† ู†ูˆุตู„ ู…ุนู†ู‰ ุฃูˆ ุงู„ู€ semantics ุจุชุงุนุฉ ุงู„ุฒุฑุงูŠุฑุŒ ุจู†ุถูŠู ุฃุฑู‚ุงู… ุนุดุงู† ุงู„ู†ุงุณ ุชุนุฑู ูƒู„ ุฒุฑุงุฑ ู‡ูŠูˆุฏูŠู‡ู… ุฃู†ู‡ูŠ ุฏูˆุฑ.

ู„ู…ุง ุชูƒุชุจ HTMLุŒ ู…ู† ุงู„ู…ู…ุงุฑุณุงุช ุงู„ูƒูˆูŠุณุฉ ุฅู†ูƒ ุชูˆุตู ุงู„ู…ุญุชูˆู‰ ุจุดูƒู„ semantic. ุฏู‡ ุจูŠุณู…ุญ ู„ู…ุญุฑูƒุงุช ุงู„ุจุญุซ ูˆุจุฑุงู…ุฌ ุงู„ู€ accessibility ุฒูŠ ุงู„ู€ screen readers ุฅู†ู‡ุง ุชูู‡ู… ู…ุญุชูˆูŠุงุช ุงู„ุตูุญุฉ.

ุนู†ุงุตุฑ ุงู„ู€ HTML ุงู„ุฃุณุงุณูŠุฉ ุงู„ู„ูŠ ู„ูŠู‡ุง ู…ุนู†ู‰

ู„ุญุณู† ุงู„ุญุธุŒ ู…ู…ูƒู† ุชุนู…ู„ ุฏู‡ ุจุงุณุชุฎุฏุงู… ุดูˆูŠุฉ tags ุฃุณุงุณูŠุฉ ููŠ HTML ู„ูŠู‡ุง ู…ุนู†ู‰:

  • ู…ุซู„ุงู‹ุŒ ุงุณุชุฎุฏุงู… Heading ุฒูŠ <h1> ุจูŠูˆุตู ุฅู† ุงู„ู…ุญุชูˆู‰ ุฏู‡ ุนู†ูˆุงู† ุฑุฆูŠุณูŠ.
  • ุจู†ูุณ ุงู„ุทุฑูŠู‚ุฉุŒ ุงู„ู€ <ul> ูˆุงู„ู€ <ol> tags ุจุชูˆุตู ุงู„ู‚ูˆุงุฆู… (Lists HTML).
  • ุจุณ ููŠู‡ ุนู†ุงุตุฑ semantic HTML ุฃูƒุชุฑ ุจูƒุชูŠุฑ ู…ุชุงุญุฉ ู„ูŠูƒ ูƒู€ developer.

ููŠ ุงู„ููŠุฏูŠูˆ ุฏู‡ุŒ ู‡ุดุฑุญ ุทุฑูŠู‚ุฉ ู…ู†ุธู…ุฉ ู…ู…ูƒู† ุชุชุจุนู‡ุง ุนุดุงู† ุชุชุฃูƒุฏ ุฅู†ูƒ ุจุชุนู…ู„ ุตูุญุฉ ูˆูŠุจ ู…ุชูƒูˆู†ุฉ ูƒูˆูŠุณ.

ุงู„ู‡ูŠูƒู„ ุงู„ุฃุณุงุณูŠ ู„ุตูุญุฉ HTML ู…ู†ุธู…ุฉ

ุงุชูƒู„ู…ู†ุง ุนู†ู‡ุง ู‚ุจู„ ูƒุฏุง Setting Up the HTML Document Structure ุจุณ ุฎู„ูŠู†ุง ู†ุฑุงุฌุน ุงู„ู‡ูŠูƒู„ ุงู„ุฃุณุงุณูŠ ู„ุตูุญุฉ HTMLุŒ ุงู„ู„ูŠ ููŠู‡ ุงู„ู€ head ูˆุงู„ู€ body. ุฌูˆู‡ ุงู„ู€ body tagุŒ ู…ู…ูƒู† ุชู†ุธู… ุงู„ู…ูˆู‚ุน ุจุงุณุชุฎุฏุงู… semantic tags ุนุดุงู† ุชูˆุตู ูƒู„ ู‚ุณู….

ุจุงู„ู†ุณุจุฉ ู„ุตูุญุฉ HTML ู†ู…ูˆุฐุฌูŠุฉุŒ ุงู„ู‡ูŠูƒู„ ู…ู…ูƒู† ู†ูˆุตูู‡ ุจุดูƒู„ semantic ุจุงุณุชุฎุฏุงู… ุงู„ู€ semantic HTML tags ุฏูŠ:

  • ุงู„ู€ <header>: ู„ู„ุฌุฒุก ุงู„ุนู„ูˆูŠ ู…ู† ุงู„ุตูุญุฉ.
  • ุงู„ู€ <main>: ู„ู„ู…ุญุชูˆู‰ ุงู„ุฑุฆูŠุณูŠ.
  • ุงู„ู€ <footer>: ู„ู„ุฌุฒุก ุงู„ุณูู„ูŠ ู…ู† ุงู„ุตูุญุฉ.

ู…ุซุงู„ ุนู„ู‰ ุชู‚ุณูŠู…ุฉ ุงู„ุตูุญุฉ:

  • ู‚ุณู… header ููŠู‡ ู„ูˆุฌูˆ ุงู„ุดุฑูƒุฉ ูˆุดูˆูŠุฉ navigation links.
  • ู‚ุณู… main ุจูŠุญุชูˆูŠ ุนู„ู‰ sections ูˆ articles.
  • ู‚ุณู… footer ุจูŠุญุชูˆูŠ ุนู„ู‰ ู…ุนู„ูˆู…ุงุช ุงู„ุงุชุตุงู„ ูˆู„ูŠู†ูƒุงุช ุงู„ุณูˆุดูŠุงู„ ู…ูŠุฏูŠุง.

ุชูุงุตูŠู„ ุงู„ุนู†ุงุตุฑ ุงู„ุฃุณุงุณูŠุฉ:

ุงู„ู€ <nav>

  • ู‚ุณู… ุงู„ู€ navigation ุงู„ุฑุฆูŠุณูŠ ููŠ ุตูุญุชูƒ ู…ู…ูƒู† ุจุฑุถู‡ ู†ูˆุตูู‡ ุจุดูƒู„ semantic ุจุงุณุชุฎุฏุงู… ุงู„ู€ nav tag.
  • ุงุชูƒู„ู…ู†ุง ุนู†ู‡ุง ููŠ Page navigation HTML
  • ุนู„ู‰ ุญุณุจ ุชุตู…ูŠู… ุงู„ุตูุญุฉุŒ ุงู„ู€ nav element ุบุงู„ุจู‹ุง ุจูŠุชุญุท ุจุนุฏ ุงู„ู€ header elementุŒ ูˆุงู„ู€ header element ุจูŠูุณุชุฎุฏู… ุนุดุงู† ุงู„ู„ูˆุฌูˆู‡ุงุช.
  • ุงู„ู„ูŠู†ูƒุงุช ุงู„ุฑุฆูŠุณูŠุฉ ู„ู„ู…ูˆู‚ุน ุจุชุชุถุงู ุฌูˆู‡ ุงู„ู€ nav element.
  • ู…ู† ุงู„ู…ู…ุงุฑุณุงุช ุงู„ุดุงุฆุนุฉ ุจูŠู† ุงู„ู€ developers ุฅู†ู‡ู… ูŠุญุทูˆุง ุงู„ู„ูŠู†ูƒุงุช ุจุชุงุนุชู‡ู… ูƒู€ unordered list (<ul>) ุฌูˆู‡ ุงู„ู€ nav element ุงุชูƒู„ู…ู†ุง ุนู†ู‡ุง ููŠ (Lists HTML).

ุงู„ู…ุญุชูˆู‰ ุงู„ุฑุฆูŠุณูŠ: <article> ูˆ <section>

ุงู„ุนู†ุตุฑูŠู† ุงู„ู€ semantic ุงู„ุฃุณุงุณูŠูŠู† ู„ู„ู…ุญุชูˆู‰ ุงู„ุฑุฆูŠุณูŠ ุจุชุงุนูƒ ู‡ู…ุง ุงู„ู€ article ูˆุงู„ู€ section elements.

ุงู„ู€ <article>

  • ุฎู„ูŠู†ุง ู†ุดูˆู ุงู„ู€ Article HTML ุงู„ุฃูˆู„.

  • ู…ูˆุงุตูุงุช ุงู„ู€ HTML ุจุชู‚ูˆู„ุŒ ุญุณุจ ู…ูˆู‚ุน World Wide Web Consortium (W3C):

    ุงู„ู€ article element ุจูŠุดูŠุฑ ู„ู…ุญุชูˆู‰ ุจูŠู…ุซู„ ุชูƒูˆูŠู† ูƒุงู…ู„ ุฃูˆ ู‚ุงุฆู… ุจุฐุงุชู‡ ููŠ ู…ุณุชู†ุฏ ุฃูˆ ุตูุญุฉ ุฃูˆ ุชุทุจูŠู‚ ุฃูˆ ู…ูˆู‚ุนุŒ ูˆุจูŠูƒูˆู† ู‚ุงุจู„ ู„ู„ุชูˆุฒูŠุน ุจุดูƒู„ ู…ุณุชู‚ู„.

  • ุงู„ูƒู„ุงู… ุฏู‡ ู…ู…ูƒู† ูŠูƒูˆู† ูƒุจูŠุฑ ุดูˆูŠุฉ.

  • ู…ู…ูƒู† ูŠุณุงุนุฏูƒ ู„ูˆ ููƒุฑุช ููŠ ุตูุญุฉ ุฌุฑู†ุงู†. ููŠู‡ ู…ู‚ุงู„ุงุช ูƒุชูŠุฑ ููŠ ุงู„ุตูุญุฉุŒ ูˆู…ู…ูƒู† ุชู‚ุต ุงู„ู…ู‚ุงู„ุงุช ุฏูŠ ุจุดูƒู„ ู…ู†ูุฑุฏ ู„ูˆ ุนุงูŠุฒ. ุงู„ู…ู‚ุงู„ุงุช ุงู„ู„ูŠ ู…ู…ูƒู† ุชุดูŠู„ู‡ุง ุฏูŠ ู‡ูŠ ุงู„ู€ article element.

  • ุฃู…ุซู„ุฉ ุนู„ู‰ ุฏู‡ ุชุดู…ู„:

    • ุจูˆุณุช ููŠ ู…ู†ุชุฏู‰ (forum post)
    • ู…ู‚ุงู„ ููŠ ู…ุฌู„ุฉ ุฃูˆ ุฌุฑู†ุงู†
    • ุชุฏูˆูŠู†ุฉ ููŠ ู…ุฏูˆู†ุฉ (blog entry)
    • ุชุนู„ูŠู‚ ู…ู† ู…ุณุชุฎุฏู… (user submitted comment)
    • ุงู„ู€ interactive widget ุฃูˆ gadget
    • ุฃูŠ ุฌุฒุก ู…ุญุชูˆู‰ ุชุงู†ูŠ ู…ุณุชู‚ู„.
  • ุฅุฒุงูŠ ุจู†ุณุชุฎุฏู… ุงู„ู€ article elementุŸ

    • ู„ู†ูุฑุถ ุฅู†ูƒ ุจุชุนู…ู„ blog ุนู† ุฃุฌุงุฒุฉ ุงู„ุตูŠู ุจุชุงุนุชูƒ.
    • ุงู„ุฃูุถู„ ุฅู†ูƒ ุชุญุท ู…ุญุชูˆู‰ ุงู„ู€ blog post ุฌูˆู‡ article elementุŒ ู„ุฅู†ู‡ ุชูƒูˆูŠู† ูƒุงู…ู„ ูˆู‚ุงุฆู… ุจุฐุงุชู‡ ุนู„ู‰ ุตูุญุฉ ุงู„ูˆูŠุจ.
    • ุงู„ู…ูุฑูˆุถ ุชุญุท ุงู„ู€ article element ุฌูˆู‡ ุงู„ู€ main element ุจุชุงุนูƒ.
    • ุจุนุฏูŠู† ุชุถูŠู ุงู„ู€ heading ูˆุงู„ู€ paragraph tags ุงู„ุนุงุฏูŠุฉ ุฌูˆู‡ ุงู„ู€ article element.
    • ุงู„ุณุจุจ ููŠ ุฅู†ู†ุง ุจู†ุนู…ู„ ูƒุฏู‡ ู‡ูˆ ุฅู† ุงู„ู€ main element ุจูŠู…ุซู„ ุจุดูƒู„ semantic ุงู„ู…ุญุชูˆู‰ ุงู„ุฑุฆูŠุณูŠ ู„ู„ุตูุญุฉ.
    • ูˆุฌูˆุงู‡ุŒ ู…ู…ูƒู† ูŠูƒูˆู† ููŠู‡ ุฃูƒุชุฑ ู…ู† article elementุŒ ุฒูŠ ู…ุซู„ุงู‹ ููŠ ุญุงู„ุฉ ู‚ุงุฆู…ุฉ ุจู€ blog posts.

ุงู„ู€ <section>

  • ุฏู„ูˆู‚ุชูŠุŒ ุฎู„ูŠู†ุง ู†ุดูˆู ุงู„ู€ section element ูˆุงุชูƒู„ู…ู†ุง ุนู†ู‡ Section HTML.
  • ู…ู…ูƒู† ุชุถูŠู section element ุนุดุงู† ุชุญุฏุฏ ุจุดูƒู„ semantic ุฃู‚ุณุงู… ู…ู†ูุตู„ุฉ ุฌูˆู‡ ุงู„ู€ article.
  • ู…ู‡ู… ู†ู„ุงุญุธ: ุงู„ู€ sections ุงู„ู…ูุฑูˆุถ ูŠูƒูˆู† ุฌูˆุงู‡ุง heading elements ุนุดุงู† ุชูˆุตู ุงู„ู€ section ุจุดูƒู„ semantic.
  • ู…ู…ูƒู† ุจุฑุถู‡ ู†ุณุชุฎุฏู… section elements ุนุดุงู† ู†ูˆุตู ุฃู‚ุณุงู… ู…ุฎุชู„ูุฉ ููŠ ุตูุญุฉ ุงู„ูˆูŠุจ ุจุชุงุนุชูƒ. ุงู„ู€ section element ู…ุด ุจูŠุญุชุงุฌ ูŠูƒูˆู† ุฌูˆู‡ article element ุจุงู„ุถุฑูˆุฑุฉ.
  • ูƒู„ ุฏู‡ ุจูŠุนุชู…ุฏ ุนู„ู‰ ุฅุฒุงูŠ ุนุงูŠุฒ ุชูˆุตู ุงู„ุตูุญุฉ ุจุชุงุนุชูƒ ุจุดูƒู„ semantic.

ุงู„ุชุฑูƒูŠุจ ุงู„ู…ุชุฏุงุฎู„ (Nesting) ู„ู„ุนู†ุงุตุฑ

  • ููŠ ุขุฎุฑ ุงู„ู…ุณุชู†ุฏ ุจูŠูŠุฌูŠ ุงู„ู€ footer element. ุฏู‡ ู…ู…ูƒู† ูŠูƒูˆู† ููŠู‡ navigation links ุฅุถุงููŠุฉ ุฃูˆ ู…ุญุชูˆู‰ ุชุงู†ูŠ.
  • ู…ู‡ู… ู†ู„ุงุญุธ: ุงู„ู€ semantic elements ู…ุด ู…ุญุตูˆุฑุฉ ุจุณ ููŠ ุงู„ู‡ูŠูƒู„ ุฏู‡.
  • ู„ุฅู† ู‡ุฏูู‡ุง ู‡ูˆ ูˆุตู ุงู„ู€ semantics ุจุชุงุนุฉ ุงู„ู…ุญุชูˆู‰ุŒ ูุงู„ุนู†ุงุตุฑ ุฏูŠ ู…ู…ูƒู† ุชุชุฏุงุฎู„ ุฌูˆู‡ ุจุนุถู‡ุง (nested)ุŒ ู„ูˆ ุฏู‡ ุจูŠูˆุตู ุงู„ู…ุญุชูˆู‰ ุจุฏู‚ุฉ.

ู…ุซุงู„ ุนู„ู‰ ุงู„ุชุฏุงุฎู„:

ุฎู„ูŠู†ุง ู†ุญุฏู‘ุซ ุงู„ู…ุซุงู„ ุงู„ู„ูŠ ูุงุช ุนุดุงู† ู†ุณุชุฎุฏู… ู‡ูŠูƒู„ semantic ู…ุชุฏุงุฎู„:

  1. ู‡ุชุถูŠู header element ุฌูˆู‡ ุงู„ู€ article element.
  2. ุฌูˆู‡ ุงู„ู€ header element ุฏู‡ุŒ ุญุท:
    • ุงู„ู€ heading element ุจุชุงุน ุนู†ูˆุงู† ุงู„ู€ blog post.
    • ุงู„ู€ paragraph element ุจูŠูˆุตู ุชุงุฑูŠุฎ ูˆุงุณู… ูƒุงุชุจ ุงู„ุจูˆุณุช.
  3. ุฌูˆู‡ ุงู„ู€ main element (ุงู„ู„ูŠ ู‡ูˆ ุจูŠุญุชูˆูŠ ุงู„ู€ article ุฃุตู„ุงู‹)ุŒ ุญุท ู…ุญุชูˆู‰ ุงู„ู€ blog post (ุฏู‡ ู…ู…ูƒู† ูŠูƒูˆู† ุฌูˆุง ุงู„ู€ article ุจุณ ุจุนุฏ ุงู„ู€ header ุจุชุงุนู‡).

ุจุณ ูƒุฏู‡.

ุงู„ุฎู„ุงุตุฉ ูˆุงู„ูุงูŠุฏุฉ

ูˆุฏู„ูˆู‚ุชูŠ ุฅู†ุช ุนุฑูุช ุฅุฒุงูŠ ุชูˆุตู ู…ุญุชูˆูŠุงุช ุตูุญุฉ ุงู„ูˆูŠุจ ุจุดูƒู„ semantic. ุตูุญุงุช ุงู„ูˆูŠุจ ุจุชุงุนุชูƒ ุจู‚ุช ุฃูƒุชุฑ accessibility ู„ุฅู† ุงู„ู…ุญุชูˆู‰ ู…ุชูˆุตู ุจุดูƒู„ semantic ุนุดุงู† ูŠุถูŠู ู…ุนู†ู‰. ุฏู„ูˆู‚ุชูŠุŒ ู…ุญุฑูƒุงุช ุงู„ุจุญุซ ูˆุจุฑุงู…ุฌ ุงู„ู€ accessibility ุชู‚ุฏุฑ ุชูู‡ู… ุจุณู‡ูˆู„ุฉ ู…ุญุชูˆูŠุงุช ุตูุญุฉ ุงู„ูˆูŠุจ ุจุชุงุนุชูƒ ุงู„ู„ูŠ ู…ุชู†ุธู…ุฉ ูƒูˆูŠุณ.

Semantic tags in action

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Little Lemon Blog</title>
</head>
<body>
 
    <!-- 1. Add the main header element for the page -->
    <header>
        <!-- 1.33: Add the logo inside the header -->
        <img src="little_lemon_logo.png" alt="Little Lemon Logo"> 
        <!-- Note: Replace 'little_lemon_logo.png' with the actual image path -->
    </header>
 
    <!-- 2. Add the navigation element -->
    <nav>
        <!-- 1.44: Add navigation links using an unordered list -->
        <ul>
            <!-- 1.52 & 2.03: Add list items with anchor tags for navigation -->
            <li><a href="index.html">Home</a></li> 
            <li><a href="location.html">Location</a></li>
            <li><a href="blog.html">Blog</a></li>
             <!-- Note: Link text like 'Home', 'Location', 'Blog' added for clarity -->
        </ul>
    </nav>
 
    <!-- 3. Add the main content element -->
    <main>
        <!-- 2.31: Add the main heading for the blog page -->
        <h1>Blog</h1>
 
        <!-- 2.39: Add the first article element for the first blog post -->
        <article>
            <!-- 2.52: Add the heading for the first blog post -->
            <h2>20% off this weekend</h2> 
            <!-- 3.06: Add the paragraph content for the first blog post -->
            <p>Come join us this weekend and get a 20% discount on your favorite meals!</p> 
            <!-- Note: Blog post text added based on context -->
        </article>
 
        <!-- 2.39: Add the second article element for the second blog post -->
        <article>
            <!-- 3.21: Add the heading for the second blog post -->
            <h2>Our new menu</h2>
            <!-- 3.31: Add the paragraph content for the second blog post -->
            <p>We are excited to introduce our brand new menu. Come and explore the flavors!</p>
            <!-- Note: Blog post text added based on context -->
        </article>
    </main>
 
    <!-- 4. Add the footer element -->
    <footer>
        <!-- 3.45 & 3.52: Add a paragraph for copyright information -->
        <p>&copy; 2024 Little Lemon Restaurant. All rights reserved.</p> 
        <!-- Note: Used &copy; for copyright symbol and added standard text -->
    </footer>
 
    <!-- 3.56: The blog page is now semantically described. -->
    <!-- Saving (Ctrl+S / Cmd+S) and previewing would happen outside the code itself. -->
 
</body>
</html>

Semantic HTML cheat sheet

Semantic HTML5 Elements Explained

ุฏูŠ ู‚ุงูŠู…ุฉ ุจุจุนุถ ุงู„ู€ tags ุงู„ู€ semantic ุงู„ุดุงุฆุนุฉ ุงู„ู„ูŠ ู…ู…ูƒู† ุชุณุชุฎุฏู…ู‡ุง ููŠ ุดุบู„ูƒ:

Sectioning tags

Use the following tags to organize your HTML document into structured sections.

  • <header>: The header of a content section or the web page. Often contains branding/logo, Header HTML.
  • <nav>: The navigation links of a section or the web page, Page navigation HTML.
  • <footer>: The footer of a content section or the web page. Often contains secondary links, copyright, policy links, Footer HTML.
  • <main>: Specifies the main content of a section or the web page, main HTML.
  • <aside>: A secondary set of content, not required to understand the main content, aside HTML.
  • <article>: An independent, self-contained block of content (e.g., blog post, product), Article HTML.
  • <section>: A standalone section of the document, often used within body and article elements, Section HTML.
  • <details>: A collapsed section of content that can be expanded, details HTML.
  • <summary>: Specifies the summary or caption of a <details> element, summary HTLM.
  • <h1> to <h6>: Headings on the web page. <h1> is most important, <h6> is least important, Heading.

Content tags

  • <blockquote>: Used to describe a quotation.
  • <dd>: Used to define a description for the preceding <dt> element.
  • <dl>: Used to define a description list.
  • <dt>: Used to describe terms inside <dl> elements.
  • <figcaption>: Defines a caption for a photo image (<figure>).
  • <figure>: Applies markup to a photo image, often used with <figcaption>.
  • <hr>: Adds a horizontal line (thematic break) to the parent element.
  • <li>: Used to define an item within a list (<ul>, <ol>, <menu>).
  • <menu>: A semantic alternative to <ul> tag for lists of commands or actions.
  • <ol>: Defines an ordered list.
  • <p>: Defines a paragraph.
  • <pre>: Used to represent preformatted text (preserves spaces and line breaks, often monospace font).
  • <ul>: Defines an unordered list.

Inline tags

Tags that apply semantics to parts of text within a block.

  • <a>: An anchor link to another HTML document or URL.
  • <abbr>: Specifies that the containing text is an abbreviation or acronym (often with a title attribute for the full form).
  • <b>: Bolds the containing text stylistically. Use <strong> for importance.
  • <br>: A line break. Moves the subsequent text to a new line.
  • <cite>: Defines the title of creative work (e.g., book, song, movie). Usually rendered in italics.
  • <code>: Indicates that the containing text is a block or snippet of computer code.
  • <data>: Indicates machine-readable data (often with a value attribute).
  • <em>: Emphasizes the containing text (stress emphasis). Usually rendered in italics.
  • <i>: The containing text is displayed in italics. Used for idiomatic text, technical terms, thoughts, etc.
  • <mark>: The containing text should be marked or highlighted (like using a highlighter pen).
  • <q>: The containing text is a short inline quotation. Browsers often add quotation marks.
  • <s>: Displays the containing text with a strikethrough (indicates inaccurate or no longer relevant text).
  • <samp>: The containing text represents sample output from a computer program.
  • <small>: Used to represent small text, such as copyright and legal text (side comments).
  • <span>: A generic inline element for grouping content, primarily for CSS styling or JS hooks, with no semantic meaning.
  • <strong>: Displays the containing text in bold. Used to indicate strong importance, seriousness, or urgency.
  • <sub>: The containing text is subscript text (displayed lower).
  • <sup>: The containing text is superscript text (displayed higher).
  • <time>: A semantic tag used to display dates, times, or durations (often with a datetime attribute for machine-readable format).
  • <u>: Displays the containing text with a solid underline. Use sparingly, as it can be confused with links. Often used for non-textual annotations like spelling errors.
  • <var>: The containing text is a variable in a mathematical expression or programming context.

Embedded content and media tags

Tags for including external content or media.

  • <audio>: Used to embed audio in web pages.
  • <canvas>: Used to render 2D and 3D graphics dynamically on web pages (usually via JavaScript).
  • <embed>: Used as a containing element for external content provided by an external application (legacy, often avoided).
  • <iframe>: Used to embed a nested web page (another HTML document).
  • <img>: Embeds an image on a web page.
  • <object>: Similar to <embed> but more standardized; can embed various external resources.
  • <picture>: An element that contains one <img> element and one or more <source> elements to offer alternative images for different displays/devices (responsive images).
  • <video>: Embeds a video on a web page.
  • <source>: Specifies multiple media resources for <picture>, <audio>, and <video> elements (e.g., different formats or resolutions).
  • <svg>: Used to define Scalable Vector Graphics within a web page.

Table tags

Tags for creating and structuring tabular data.

  • <table>: Defines a table element to display table data.
  • <thead>: Represents the header content (group of header rows) of a table. Typically contains one or more <tr> elements with <th> cells.
  • <tbody>: Represents the main content (group of data rows) of a table. Contains one or more <tr> elements with <td> cells.
  • <tfoot>: Represents the footer content (group of footer rows) of a table. Typically contains one or more <tr> elements with <td> or <th> cells.
  • <tr>: Represents a row in a table.
  • <td>: Represents a data cell in a table (standard cell).
  • <th>: Defines a header cell of a table (used for row or column headers).
  • <caption>: Defines the caption (title) of a table element. Should be the first child of <table>.
  • <colgroup>: Defines a semantic group of one or more columns in a table for formatting.
  • <col>: Defines semantic properties for a column within a <colgroup>. Usually empty, uses attributes like span.