Friday 30 January 2015

Latest HTML5 Interview Questions and Answers pdf (Part6)

26. What’s new HTML 5 DocType and Charset?
As HTML 5 is now not subset of SGML so its DocType is simplified as follows:
                  <!doctype html>
And HTML 5 uses UTF-8 encoding as follows:
                 <meta charset=”UTF-8?>

27. How can we embed Audio in HTML 5?
HTML 5 comes with a standard way of embedding audio files. Supported audio formats are MP3, Wav and Ogg.
<audio controls>
    <source src=”jamshed.mp3? type=”audio/mpeg”>
    Your browser does’nt support audio embedding feature.
</audio>

28. How can we embed Video in HTML 5?
Same like audio, HTML 5 defined standard way of embedding video files.Supported video formats are MP4, WebM and Ogg.
<video width=”450? height=”340? controls>
  <source src=”jamshed.mp4? type=”video/mp4?>
   Your browser does’nt support video embedding feature.
</video>

29. What are the new media element in HTML 5 other than audio and video?
HTML 5 has strong support for media. Other than audio and video tags, it comes with the following tags:
<embed> acts as a container for external application.
<track> defines text track for media.
<source> is helpful for multiple media sources for audio and video.

30. What are the different types of storage in HTML 5?
HTML 5 has the capability to store data locally. Previously it was done with the help of cookies.
Exciting thing about this storage is that its fast as well as secure.
There are two different objects which can be used to store data.
localStorage object stores data for a longer period of time even if the browser is closed.
sessionStorage object stores data for a specific session.
More Questions & Answers :-
Part1  Part2  Part3  Part4  Part5  Part6  Part7  Part8  Part9  Part10

No comments:

Post a Comment