Basics Flashcards
Describe any two new features of HTML5.
HTML 5 comes up with many new features including video/audio elements for media playback and better support for local offline storage.
What does a ‹hgroup› tag do?
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.
Which video formats are used for the video element?
Ogg, MPEG4, WebM
How can we embed video in HTML5?
‹video src=”movie.ogg” controls=”controls”›‹/video›
Which video format is supported by IE?
IE supports MPEG4 and WebM.
Name the audio formats supported in HTML5.
Ogg Vorbis, MP3, WAV
What will the following code do?‹audio src=”song.ogg” controls=”controls”›‹/audio›
It will play the audio file named song.ogg.
How will you define canvas with reference to HTML5?
It is a rectangular area, where we can control every pixel.
Give an example of adding canvas in HTML5?
‹canvas id=”myCanvas” width=”200” height=”100”›‹/canvas›
Which methods/approaches are available in HTML5 to store data?
Local Storage persists
Session Storage is lost on window close etc
Write a code snippet in HTML or Javascript that can count how many times a user visited the page.
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 can you test your browser’s HTML5 compatibility?
Visiting http://html5test.com checks the browser’s HTML5 compatibility and shows scores.