Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons
  • Teach on BraveProgrammer

© 2026 BraveProgrammer. All rights reserved.

Microdata & Structured Data – Schema.or | HTML Course lesson | BraveProgrammer
  1. Courses
  2. /
  3. HTML Course

Lesson 41 of 55

·HTML

Microdata & Structured Data – Schema.org

10 min

Course progress75%

What you'll learn

Keep these ideas in mind as you work through the lesson.

5 points
  • Embedding microdata with `itemscope`, `itemtype`, `itemprop` attributes
  • Schema.org vocabularies for people, articles, products, events, etc.
  • JSON‑LD as the modern, preferred method for structured data
  • Testing structured data with Google’s Rich Results Test and other validators
  • Common pitfalls: mismatched types, missing required properties

Structured Data with Microdata

Microdata lets you embed machine‑readable data directly in HTML using itemscope, itemtype, and itemprop.

<div itemscope itemtype='https://schema.org/Person'>
  <h1 itemprop='name'>Jane Doe</h1>
  <p>Web developer based in <span itemprop='address'>Seattle</span>.</p>
  <a href='mailto:jane@example.com' itemprop='email'>jane@example.com</a>
</div>

Key attributes

  • itemscope – Declares a new entity (the start of a microdata block).
  • itemtype – URL pointing to a Schema.org type (e.g., Person, Article, Product).
  • itemprop – Property name of the entity; the text/value of the element becomes the property's value.

JSON‑LD alternative (recommended)

<script type='application/ld+json'>
{
  "@context": "https://schema.org",
  "@type": "Person",
  "name": "Jane Doe",
  "url": "https://example.com",
  "email": "mailto:jane@example.com",
  "address": {
    "@type": "PostalAddress",
    "addressLocality": "Seattle",
    "addressRegion": "WA"
  }
}
</script>

JSON‑LD keeps your markup clean and is easier to maintain.

Validation

  • Use Google’s Rich Results Test or Schema Markup Validator to verify that search engines can read your markup.
  • Check the Structured Data Testing Tool (now part of Search Console) for warnings.

Quick checklist for structured data

  1. itemscope and itemtype used where appropriate? ✅
  2. itemprop names follow Schema.org vocabulary? ✅
  3. JSON‑LD added for complex entities? ✅
  4. Validation passed in Google Rich Results Test? ✅
  5. No duplicate @type definitions that could confuse parsers? ✅

Tip: Start with JSON‑LD for most use‑cases, and fall back to Microdata only when you need inline markup for a legacy CMS.

Make it stickPractice what you've learned1 quiz · 2 practical tests · Optional activities from HTML CourseBrowse activities
Previous lessonFinal Project – Build an Accessible Portfolio SiteContinue to lesson 42The `<picture>` Element and Responsive ImagesBack to HTML Course curriculum