Coding Basics: Intro to HTML Syntax
Master the fundamental building blocks of web development
Essential HTML Components
Document Structure
Learn the HTML, head, title, and body tags that form the foundation of every webpage. These elements create the basic document structure.
Content Elements
Master headings, paragraphs, lists, and text formatting tags. These elements organize and present your content effectively.
Document Metadata
Understand doctype declarations, language attributes, and meta tags. These enhance SEO and accessibility for your pages.
Setting Up Your Development Environment
Launch Code Editor
Open Visual Studio Code, Sublime Text, or your preferred code editor to begin writing HTML code.
Open Project Folder
Navigate to File > Open Folder and select the News website folder to access all project files.
Trust Author Settings
When prompted about trusting the author, check the trust option and click Yes to proceed with file editing.
Open HTML File
Click on Microsoft.html in the file panel to begin adding HTML tags to the existing text content.
HTML Heading Hierarchy
Headings help organize content for quick skimming, make pages more accessible for screen readers, and help search engines understand your content structure for better ranking.
Line breaks in HTML code are ignored by web browsers. You must use paragraph tags to properly separate content into readable blocks with appropriate spacing.
Unordered vs Ordered Lists
| Feature | Unordered Lists (ul) | Ordered Lists (ol) |
|---|---|---|
| Visual Style | Bullet points | Numbers or letters |
| Use Case | Non-sequential items | Step-by-step processes |
| HTML Tag | <ul> | <ol> |
| List Items | <li> for each item | <li> for each item |
Text Emphasis Tags
Strong Tag
Renders as bold text in browsers and indicates important content. Also affects screen reader pronunciation for accessibility.
Em Tag
Renders as italic text and represents emphasized content. Changes speaking style in screen readers for visually impaired users.
Add character encoding specification to ensure proper text rendering across all platforms:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Microsoft Patents Ones and Zeroes—The Onion</title>
</head>
The charset meta tag specifies UTF-8 encoding, enabling your page to display international characters, symbols, and emoji correctly across all devices and operating systems. This meta element must appear within the first 512 bytes of your HTML file, which is why it's positioned as the head section's first child—a best practice that prevents encoding issues in any browser.
Excellent work! You've created a complete, standards-compliant webpage that demonstrates fundamental HTML structure and semantic markup. Keep this file open—we'll build upon this foundation in the next exercise where you'll learn to enhance the visual presentation with CSS.
Attributes are modifiers of HTML elements. Most attributes have a name and a value. Attributes are only added to a start tag.
Congratulations! You have successfully created a complete webpage with proper HTML structure, semantic tags, and essential metadata for SEO and accessibility.
Key Takeaways
