• Register
24,470 points
12 6 3

1. What is HTML5?

HTML5 is the latest version of the HyperText Markup Language that can be referred to the WWW (World Wide Web) primary language, this markup language enhances a text file with bits of code, and this code which we can say as “markup” describes the structure of the document.

HTML5 provides some standard features like that of CSS, HTML, JavaScript, and DOM, which in turn will reduce the requirement of external plugins. It’s more markup to replace scripting, better error handling, etc. HTML5 is device independent.

HTML5 introduces some new features that can be used to change the way of user interaction with documents including:

Adding new parsing rules to enhance flexibility.

Adding New attributes.

Allow offline editing.

Support (Web SQL), – A common standard for storing data in SQL databases.

Support Protocol and MIME handler registration.

2. What is <!DOCTYPE>? What are the different types of <!DOCTYPE> that are available?

The <!DOCTYPE> declaration provides instruction to the web browser to understand what information it should be display, and the need to start with <!DOCTYPE> declaration. In HTML5, DOCTYPE declaration is very short, and case-insensitive, and <!DOCTYPE html> is written at the top of every HTML5 page.

The following DOCTYPE are also supported in HTML5:

<!DocTYpe html>

<!dOCtype html>

<!doctype html>

There are 3 types of DOCTYPES as mentioned below:

Strict Doctype

Frameset Doctype

Transitional Doctype

3. What are the New tags in Media Elements in HTML5?

The new tags in Media Elements in HTML5 are enlisted below:

<audio>: Apply for multimedia contents like sounds, audio streams or music, embed audio content without the requirement of any additional plug-in like flash player.

<video>: Apply for video content like video streams or movie clip, embed video content etc.

<source>: Apply for multiple media resources in media elements, such as audio, video, picture etc.

<embed>: Apply for an external application or embedded content (a plug-in).

<track>: Apply for text tracks in the media elements such as video or audio. This tag is used for subtitles or caption files while the video media is playing.

4. What is a tag in HTML5?

A tag is a special content in HTML5, which is surrounded by an angle bracket (<,>). A slash (/) symbol is used to close the tag after completing the block.

For Example

<title> This is my Browser </title>

An Html5 tag is a set of characters that develop a formatted command for a web page. These formatted commands communicate and send the instruction to the Browser.

5. What is the minimum number of HTML5 tags that are required to create a Web page?

Minimum 3  HTML5 tags are required to create a Web page, such as (<HEAD>, <BODY>, <HTML>).

6. What is the importance of Drag and Drop in HTML5?

Drag and Drop is the most important User Interface concept which makes it easy to grab an object and Drag it at the place you want with the help of a mouse click.

Some common features that are mostly used by Drag and Drop operation include move, link or copy.

We can drag an image using elements, type = <img draggable = &ldquo;true&rdquo;>, to make an image draggable and set the draggable image attribute to true.

7. Explain new Form input types in HTML5.

HTML5 has 14 new forms input types:

Date: This is a Date picker, we can pick a date by using type = &ldquo;date&rdquo;.

Week: This is a Week picker, we can pick a week by using type = &ldquo;week&rdquo;.

Month: This is a Month picker, we can pick a month by using type = &ldquo;month&rdquo;.

Time: This is a Time picker, we can pick the time by using type = &ldquo;time&rdquo;.

Datetime: This is a combined date and time, we can pick the combination of date and time by using type = &ldquo;datetime&rdquo;.

Datetime-local: A combined local date and time, we can pick the combination of local date and time using type = &ldquo;DateTime-local&rdquo;.

Email: Allows one or more Email Addresses, we can enter multiple email addresses using type = &ldquo;email&rdquo;.

Tel: Allows different phone numbers around the world. A phone number is validated by the client-side. We can enter a phone number using type = &ldquo;tel&rdquo;.

Search: Allows to search queries by input text. We can enter multiple queries using type = &ldquo;search&rdquo;.

Number: Allows inserting a numerical value with additional attributes such as min, max. etc., and we can enter multiple numerical values using type = &ldquo;number&rdquo;.

Url: A url input type, that is used for the web address. In a single url, we can use multiple attributes using type = &ldquo;url&rdquo;.

Color: Allows to select multiple colors, we can pic multiple color using type = &ldquo;color&rdquo;.

Range: Allows to insert a numerical value within a specific range, Range is similar to the number but it is much specific. We can enter a numerical value within a range using type = &ldquo;range&rdquo;.

Placeholder: Allows to display a short hint (usually in a light color) in the input fields, before we enter the value. We can write a short hint in the input field by using type = &ldquo;placeholder&rdquo;.

8. What is image map in html5?

Image maps are a combination of URL and images, where clicking on these images (clickable area of the image) will open different new web pages.

Two types of image maps are available in HTML5, i.e. client side and server side:

The client-side image map is created by using two elements <area> and <map>, where the map holds the map information and the area element takes the attributes to define each section of the map. Server-side image map created by using <usemap> attribute, the usemap attribute is the name of our map.

9. How do you write a copyright symbol on a web browser page?

In order to write a copyright symbol, we need to type &copy; or &#169; in an HTML5 file.

10. How to optimize website assets?

We need to understand some basic optimization rules, in order to optimize website assets. Initially, we should decrease the download size and make fewer http requests.

To optimize website assets we can follow the below techniques:

File compression

File concatenation

CDN Hosting

Offloading assets


Refining code

11. Why do we use HTML5?

HTML5 supports animation, drawing, audio, video, etc and it easily embeds a video on the web page. It does not require any additional software like Flash for watching videos.

Some of the important reasons to use HTML5 are given below:

  • Legacy and cross-browser support
  • Better interactions
  • Smarter storage
  • Cleaner code

12. Explain the concept of web storage in HTML5.

Web storage provides the facility to store the data of our web applications locally into the user&rsquo;s browser. It can store up to 10 MB data. Web storage helps to increase the performance of our applications.

There are two types of web storage that are used to store data locally in HTML5:

Local storage: This stores the data that will not expire or clear automatically when a user closes or reopens a browser.

Session Storage: This stores data for one session only(i.e, a user who is surfing the internet or website). Once the browser is closed, session data will automatically delete from the web browser.

13. What are the advantages of using HTML5?

HTML5 is the advanced version of HTML. HTML5 enables to create easier or interactive websites by embedding video, audio, and graphics on the web page.

HTML5 support multimedia technology and graphical content to the web without using any third party plugins.

Some of the most important features added by HTML5 include:

  • Geolocation
  • Offline Application Cache
  • Client-side database
  • Error Handling
  • New Structure and new multimedia elements.
  • Browser Support and compatibility.
  • Supports Some New Application Programming Interface (API) like:
  • Browser History Management
  • Drag and Drop
  • 2D drawing on a web page
  • Time media playback
  • Supported Applications include:
  • Web Workers &ndash; JavaScript
  • Local File Access
  • Application Cache
  • Local data storage
  • Local SQL databases