<header>
<h1>
Everything you need to know about pizza!
</h1>
</header>
By using a header tag, our code becomes easier to read. It is much easier to identify what is inside of the h1‘s parent tags,
as opposed to a div tag which would provide no details as to what was inside of the tag.
A nav is used to define a block of navigation links such as menus and tables of contents. It is important to note that nav can be used inside of the header element but can also be used on its own.
nav 태그는 다른 페이지 또는 현재 페이지의 다른 부분과 연결되는 네비게이션 링크(navigation links)들의 집합을 정의할 때 사용합니다.
<header>
<nav>
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#about">About</a></li>
</ul>
</nav>
</header>
<body>
<div id="header">
<h1>Navigational Links</h1>
div는 따로 정보가 들어가있지 않아서 id로 정보 추가적으로 넣어줬어야 한다
이럴 바엔 header/ nav을 쓰는 것이 더 낫다
<body>
<header>
<h1>Navigational Links</h1>
<div id="nav">
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#posts">Posts</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</div>
</header>
<main>
<header>
<h1>Types of Sports</h1>
</header>
<article>
<h3>Baseball</h3>
<p>
The first game of baseball was played in Cooperstown, New York in the summer of 1839.
</p>
</article>
</main>
<footer>
<p>Email me at Codey@Codecademy.com</p>
</footer>
<section>
<h2>Fun Facts About Cricket</h2>
</section>
<section>
<h2>Fun Facts About Cricket</h2>
<article>
<p>A single match of cricket can last up to 5 days.</p>
</article>
</section>
<article>
<p>The first World Series was played between Pittsburgh and Boston in 1903 and was a nine-game series.</p>
</article>
<aside>
<p>
Babe Ruth once stated, “Heroes get remembered, but legends never die.”
</p>
</aside>
<figure>
<img src="overwatch.jpg"/>
</figure>
<figure>
<img src="overwatch.jpg">
<figcaption>This picture shows characters from Overwatch.</figcaption>
</figure>
<audio>
<source src="iAmAnAudioFile.mp3" type="audio/mp3">
</audio>
we created an audio element.
Then we created a source element to encapsulate our audio link.
In this case, iAmAnAudioFile.mp3 is our audio file.
we specified the type by using type and named what kind of audio it is.
Although not always necessary, it’s recommended that we state the type of audio as it helps the browser identify it more easily and determine if that type of audio file is supported by the browser.
we need to give it controls. This is where attributes come in.
Attributes provide additional information about an element.
Attributes allow us to do many different things to our audio file.
There are many attributes for audio but today we’re going to be focusing on controls and src.
- controls: automatically displays the audio controls into the browser such as play and mute.
- src: specifies the URL of the audio file.
For example, here’s how we could add both autoplay functionality and audio controls:
<audio autoplay controls>
example :
<audio controls >
<source src="https://content.codecademy.com/courses/
SemanticHTML/dogBarking.mp3" type="audio/mp3">
</audio>
By using a video element, we can add videos to our website.
video element makes it clear that a developer is attempting to display a video to the user.
Some attributes that can alter a video playback include:
- controls:
When added in, a play/pause button will be added onto the video along with volume control and a fullscreen option.- autoplay:
The attribute which results in a video automatically playing as soon as the page is loaded.- loop:
This attribute results in the video continuously playing on repeat.
<video src="coding.mp4"
controls>Video not supported</video>
Another tag that can be used to incorporate media content into a page is the embed tag, which can embed any media content including videos, audio files, and gifs from an external source.
websites that have an embed button have some form of media content that can be added to other websites.
The embed tag is a self-closing tag, unlike the video element.
태그는 mp3,asf,wma,wmv,swf등의 확장자를 가진 파일을 인터넷에서 재생시켜주는 태그입니다. 즉, 동영상이건 플래시건 음악이건 죄다 이걸로 재생 가능. src 꼭 필요
<embed src="download.gif"/>