html 4
html 4
Semantic HTML
Semantic HTML
Semantic HTML introduces meaning to the code we write. Before Semantic <!--Non Semantic HTML-->
HTML the elements didn’t have any meaning as to what it does or what content
<div id="footer">
goes in it. An element such as <div> was used as a general-purpose element
to create things from headers to footers to articles. With Semantic HTML we <p>this is a footer</p>
were introduced to elements that tell developers and browsers exactly what it </div>
does and what content should go in it.
<!--Semantic HTML-->
<footer>
<p>this is a footer</p>
</footer>
Element Placement
Semantic HTML introduces elements that can tell developers exactly what the
element does or where it’s placed based on the name of that element. Some of
these elements are <header> , <nav> , <main> , and <footer> .
<header> describes the content at the top of the page <body> . It may
include a logo, navigational links or a search bar. <nav> encapsulates the
page’s navigational links. It is often placed inside the <header> or <footer> .
<main> encapsulates the main content of a page between the
header/navigation and the footer areas. <footer> includes the page’s footer
content at the bottom of the <body> .
1 of 3 3/26/2023, 4:51 PM
Firefox about:srcdoc
Embedding media
Semantic HTML introduces us to <video> , <audio> and <embed> . <!--Video Tag-->
<video> allows us to add videos to our website. <audio> allows us to <video src="4kvideo.mp4">video not supported</video>
implement audio into our website. <embed> can be used to implement any
type of media. These elements are universal in that they all use the src
attribute to link the source of the content. <video> and <audio> requires a <!--Audio Tag-->
closing tag while <embed> is a self-closing tag. <audio src="koreanhiphop.mp3"></audio>
<!--Embed tag-->
<embed src="babyyoda.gif"/>
2 of 3 3/26/2023, 4:51 PM
Firefox about:srcdoc
Print Share
3 of 3 3/26/2023, 4:51 PM