.
Previous

Interview Questions on HTML

41. What is <canvas> element?

The HTML <canvas> element is used to draw graphics on a web page.
Syn :- <canvas id="myCanvas" width="200" height="100"></canvas>

42. What is SVG?

SVG stands for Scalable Vector Graphics
SVG is used to define graphics for the Web
SVG is a W3C recommendation

43. What is Differnce b/w canvas and svg?

SVG is a language for describing 2D graphics in XML.
Canvas draws 2D graphics with a JavaScript).

44. How to display Video in HTML ?

<video width="320" height="240" >
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>

45. How to display controls in video tag?

<video width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>

46. How to play video automatically in HTML ?

Use autoplay attribute in video tag.
<video width="320" height="240" autoplay>
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>

46. How to play Audio files ?

<audio controls>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>

47. How to display flash image or .swf images in HTML?

Use <object> tag.
<object width="400" height="50" data="fliname.swf"></object>

48. How to play youtube video in HTML?

Use :
<iframe width="420" height="315" src="http://www.youtube.com/embed/XGSy3_Czz8k?autoplay=1">
</iframe>

49. Which one is used for largest heading <h1> or <h6>?

<h1>


Previous