HTML - Semantic HTML Part 2
Instructors: Jess, Carmen, and Eda
Semantic HTML
Before this session, please:
- Read Working with Text and Time Semantic Elements: How Do Block and Inline Quotes Work in HTML? and take notes
- Read Working with Text and Time Semantic Elements: How Do You Display Abbreviations in HTML? and take notes
- Read Working with Text and Time Semantic Elements: How Do You Display Addresses in HTML? and take notes
- Read Working with Text and Time Semantic Elements: How Do You Display Times and Dates in HTML? and take notes
- Try to go through all the steps from Build Quincy’s Job Tips Page, recording any questions or new concepts introduced
During this session, we’ll:
- Review notes
- Review notes
- Review notes
- Review notes
- We’ll work through steps from Build Quincy’s Job Tips Page and talk more about semantic HTML elements
After this session, please:
- Read Working with Specialized Semantic Elements: How Do You Display Mathematical Equations and Chemical Formulas in HTML? and take notes
- Read Working with Specialized Semantic Elements: How Do You Represent Computer Code in HTML? and take notes
- Read Working with Specialized Semantic Elements: What Are the U, S, and Ruby Elements Used For, and How Do They Work? and take notes
- Try to go through all the steps from Build a Cat Blog Page, recording any questions or new concepts introduced
- Complete Build an Event Hub on your own over the next few days.
- Read Semantic HTML Review and take notes
- Complete the Semantic HTML Quiz on your own to test your understanding of Semantic HTML
Instructor Notes
Working with Text and Time Semantic Elements: How Do Block and Inline Quotes Work in HTML?
Using elements that allow us to mark text as quotations adds valuable semantic context for our users. You’ll want to use these elements to mark text that you didn’t write.
Inline quote elements: Shorter quotes that are incorporated into a larger paragraph element. These can have a cite attribute, which you can use to point to the URL of the source
Block quote elements: Longer, standalone quotes that make up their own text based element. These can have the cite attribute like inline quotes but can also have a cite element after your block quote element to add text to your page which contains the citation information
Working with Text and Time Semantic Elements: How Do You Display Abbreviations in HTML?
Tech and web development LOVES to use acronyms and initialisms. We can use a special HTML element to add semantic context that the text it contains is an abbreviation.
The abbreviation element doesn’t add a lot of additional information when used alone, but using the title element with it lets you share the unabbreviated meaning of the term. The title will be available to users via assistive technologies and some browsers will show the title attribute text when you hover over the abbreviation.
For example:
<p><abbr title=“You only live once”>YOLO</abbr> is very dated slang.</p>
Working with Text and Time Semantic Elements: How Do You Display Addresses in HTML?
Users who use screen readers need to listen to the content of your website being read to them, which can take a long time. By using semantic HTML to mark information that might be important to them, you allow them to skip right to the content they need.
Information like addresses can be especially important, so we have an element to semantically mark them.
Using address elements also adds extra functionality for all users.
We can make a phone number dialable from users on many devices using the anchor tag. A mailto tag can make it easier for your users to email you but can also result in more spam!
Working with Text and Time Semantic Elements: How Do You Display Times and Dates in HTML?
Times are always hard in programming because timezones make them hard in real life!
We can use the time element to semantically mark times in our HTML. We can use it with human-readable times and don’t need to change our formatting to use this element.
The datetime element is used to make specific dates and times machine readable. We need to use a specific format for this element.
Whenever you use the datetime element make sure to build your date from the longest time period to the shortest, going Year-Month-Day, like this.
Today is 2026-05-11
To add time to your datetime element, add a T after the date and then add the time using 24 hour clock times. For example:
Today I woke up at 2025-05-11T06:00
Build Quincy’s Job Tips Page
Questions to think about:
- Why are our sections nested in the main element? What is that trying to communicate semantically?
- Why did we use — to get a - to show on our page?
- What do we think an HTML entity might be?