Basics Flashcards

1
Q

Describe any two new features of HTML5.

A

HTML 5 comes up with many new features including video/audio elements for media playback and better support for local offline storage.

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

What does a ‹hgroup› tag do?

A

It is used for heading sections. Header tags used are from ‹h1› to ‹h6›. The largest is the main heading of the section, and the others are sub-headings.

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

Which video formats are used for the video element?

A

Ogg, MPEG4, WebM

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

How can we embed video in HTML5?

A

‹video src=”movie.ogg” controls=”controls”›‹/video›

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

Which video format is supported by IE?

A

IE supports MPEG4 and WebM.

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

Name the audio formats supported in HTML5.

A

Ogg Vorbis, MP3, WAV

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

What will the following code do?‹audio src=”song.ogg” controls=”controls”›‹/audio›

A

It will play the audio file named song.ogg.

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

How will you define canvas with reference to HTML5?

A

It is a rectangular area, where we can control every pixel.

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

Give an example of adding canvas in HTML5?

A

‹canvas id=”myCanvas” width=”200” height=”100”›‹/canvas›

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

Which methods/approaches are available in HTML5 to store data?

A

Local Storage persists

Session Storage is lost on window close etc

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

Write a code snippet in HTML or Javascript that can count how many times a user visited the page.

A

We can code the counter in Javascript and can call it from our web page written in HTML.‹script type=”text/javascript”›
if (sessionStorage.pagecount)
{
sessionStorage.pagecount=Number(sessionStorage.pagecount) +1; }
Else
{
sessionStorage.pagecount=1;
}
document.write(“Visits “+sessionStorage.pagecount+” time(s) this session.”); ‹/script›

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

How can you test your browser’s HTML5 compatibility?

A

Visiting http://html5test.com checks the browser’s HTML5 compatibility and shows scores.

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