oldoc63 / learningHTML

Learning HTML with Codecademy and GitHub
0 stars 0 forks source link

Semantic intro #62

Closed oldoc63 closed 2 years ago

oldoc63 commented 3 years ago

When building web pages, we use a combination of non-semantic HTML and Semantic HTML. The word semantic means “relating to meaning,” so semantic elements provide information about the content between the opening and closing tags.

oldoc63 commented 3 years ago

By using Semantic HTML, we select HTML elements based on their meaning, not on how they are presented. Elements such as <div> and <span> are not semantic elements since they provide no context as to what is inside of those tags.

oldoc63 commented 3 years ago

For example, instead of using a <div> element to contain our header information, we could use a <header> element, which is used as a heading section. By using a <header> tag instead of a <div>, we provide context as to what information is inside of the opening and closing tag.