Medium 1
Medium 1
o Semantic HTML refers to using HTML tags that convey the meaning of the content,
such as <header>, <footer>, <article>, and <section>.
2. What are the new form elements introduced in HTML5?
o New form elements include <input type="email">, <input type="url">, <input
type="number">, <input type="date">, <input type="range">, <input type="color">,
<datalist>, <output>, and <progress>.
3. What are HTML5 web storage methods?
o HTML5 provides two web storage methods: localStorage and sessionStorage.
4. What is the difference between localStorage and sessionStorage?
o localStorage stores data with no expiration time, whereas sessionStorage stores
data for the duration of the page session.
5. How do you embed a video in an HTML page?
o Use the <video> tag with the src attribute or <source> elements.
<video controls>
<source src="movie.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
<audio controls>
<source src="audio.mp3" type="audio/mp3">
Your browser does not support the audio tag.
</audio>
<picture>
<source srcset="image-large.jpg" media="(min-width: 800px)">
<source srcset="image-small.jpg" media="(max-width: 799px)">
<img src="image.jpg" alt="Responsive image">
</picture>
html
Copy code
<progress value="50" max="100"></progress>
22. What is the difference between defer and async attributes in the <script> tag?
o The defer attribute loads the script after the HTML document has been parsed, while
the async attribute loads the script asynchronously as soon as it is available.
23. How do you include an SVG in an HTML document?
o You can include an SVG using the <svg> tag or embed it using the <img> tag.
<div class="banner">
<img src="ad.jpg" alt="Ad">
<button class="close">Close</button>
</div>