Semantic html Flashcards

1
Q

Why use semantic html?

A

Accessibility: Semantic HTML makes webpages accessible for mobile devices and for people with disabilities as well.
SEO: It improves the website SEO, or Search Engine Optimization, which is the process of increasing the number of people that visit your webpage.
Easy to Understand: Semantic HTML also makes the website’s source code easier to read for other web developers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the difference between semantic elements and non-semantic elements?

<div> </div>

            <header> </header>   

<div> </div>

            <nav> </nav>

<div> </div>

            <article> </article>

<div> </div>

            <figure> </figure>

<div> </div>

            <footer> </footer>
A

Semantic elements provide information about the content between the opening and closing tags.
Non-semantic elements don’t provide information between the opening and closing tags.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the <header> element use for?

A

A <header> is a container usually for either navigational links or introductory content containing <h1> to <h6> headings.
By using a <header> tag, our code becomes easier to read.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is <nav> used for?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Name two more structural elements?

A

<main> The element <main> is used to encapsulate the dominant content within a webpage.
<footer> The content at the bottom of the subject information is known as the footer.
The footer contains information such as:
Contact information
Copyright information
Terms of use
</footer></main></main>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What’s the <section> element?

A

<section> defines elements in a document, such as chapters, headings, or any other area of the document with the same theme.
</section>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What’s the <article> element?

A

The <article> element holds content that makes sense on its own. <article> can hold content such as articles, blogs, comments, magazines, etc.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What’s the <aside> element?

A

The <aside> element is used to mark additional information that can enhance another element but isn’t required in order to understand the main content.
e.g. Comments, quotes, additional info.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What’s the <figure> element?</figure>

A

<figure> is an element used to encapsulate media such as an image, illustration, diagram, code snippet, etc, which is referenced in the main flow of the document.
</figure>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What’s the <figcaption> element?

A

<figcaption> is an element used to describe the media in the <figure> tag.
e.g.
<figure>
<img></img>
<figcaption>This picture shows characters from Overwatch.</figcaption>
</figure>
</figure></figcaption>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What’s the <audio> element?</audio>

Adding the attribute:
control; automatically displays the audio controls into the browser such as play and mute.
src; specifies the URL of the audio file.
autoplay; plays when browser is loaded.

A

The <audio> element is used to embed audio content into a document.
Like <video>, <audio> uses src to link the audio source.
Specifying the type=audio/ is not necessary it's recommended as it helps the browser identify it more easily and determine if that type of audio file is supported by the browser.</audio></video></audio>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

<video> </video>

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

<embed></embed>

a self closing tag.
“Taught for legacy purposes only.”

A

Another tag that can be used to incorporate media content into a page is the <embed></embed> tag.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly