From the course: HTML for Programmers

Unlock the full course today

Join today to access over 24,500 courses taught by industry experts.

Semantic HTML and accessibility

Semantic HTML and accessibility

From the course: HTML for Programmers

Semantic HTML and accessibility

- [Instructor] In the previous lesson, we introduced the <div> and <span> elements, which are generic containers for grouping content into meaningful blocks. When we created our social card, we wanted to wrap the profile picture, name, geographic location, and button into one top level element which helps with readability and styling. But there is no social card HTML element, so we used a <div> to group these elements. Both <div> and <span> are non-semantic elements, which means they don't provide any meaningful idea of what the content inside will contain. Semantic elements have meaning. For example, an <h1> element is semantic because it tells the user and the browser the content inside this tag is a heading. You should always use semantic elements before using a non-semantic element. Some semantic elements include header, footer, and nav. You can clearly tell what the content inside these tags will contain. There are…

Contents