- What is the difference between HTML5 and HTML?
Before we proceed further, it is important to understand the different between two. So, here it is –
|This is a Hypertext markup language.||HTML5 is the newer extended version of the HTML|
|Doctype declaration in Html:-
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01//EN” “http://www.w3.org/TR/html4/strict.dtd”>
|DOCTYPE declaration in Html5:-
|Audio and Video are not part of HTML.||Audio and Videos are integral part of HTML5 e.g. <audio>..</audio> tag and <video>..</video> tags.|
|In the HTML, Not possible to draw shapes like circle, rectangle, triangle, polygon.||In Html5, possible to draw shapes like circle, rectangle, triangle, and polygon.|
|In the HTML, Vector Graphics is possible with the help of technologies like VML, Silverlight, Flash etc||In the HTML5, Vector graphics is an integral part of SVG and canvas.|
- What is <!DOCTYPE>? Why is it necessary to use in HTML5?
The <!doctype> is initialised under the <html> tag. The <!doctype> is used to indicate type and version of HTML is used. This doesn’t have an ending tag and is not case sensitive. Also, The <!doctype> is important in older HTML versions because indicating the <!doctype> helped in the process of DTD (document type definition). Because HTML 4.0.1 was based on SGML (standard generalised markup language). It is not same as HTML5 since not dependent on SGML and no data type definition is required.
- What are the new media elements in HTML5? Why is canvas used in HTML?
The new media elements include:
- <audio> – For sounds, music, and other audio streams.
- <video> – For video clips, movies or any other video streams.
- <source> – To define the source of media elements that are defined inside the webpage as audio or video.
- <track> – To define the tracks that are used in different media players such as mp3, mp4 players.
- <canvas> – We can use canvas tag in HTML5 to add various elements together.
- It supports embedding graphics, audio, and video content via the new tags <canvas>, <audio>, and <video>.
- New form control tags are <date>, <time>, <calendar>, <search>, <email>, and <url>.
- New semantic tags were also complement the logical structure of modern web applications. It includes the <main>, <article>, <nav>, <section>, <aside>, <header>, and <footer> tags.
- What is the difference between span and div?
|Div (division) element is block-line.||Span element is inline.|
|In the <div> tag, the rectangular object which cannot be broken over several lines.||The <span> tag is used for applying and grouping styles to inline elements.|
|The div element is the most common method for laying out web pages using CSS and for identifying the structural sections of the document.||Div tag can be placed inside the paragraph without affecting the appearance of the text. It is very easy to customize according to your needs.|
- Which browsers support HTML5?
HTML5 features supported by the latest versions of Google Chrome, Mozilla Firefox, Apple Safari, and Opera browsers.
- Name two new tags included in the HTML 5
HTML5 version have <Video> and <Audio> are new tags. They are used as a replacement for Flash, Silverlight etc features.
- What are the two semantic tags in HTML5 version?
There are two semantic tags are <article> and <section>.
- <section> tag – It defines sections in a document like chapters, headers, footers or other sections of the document.
- <article>tag – It specifies the independent and self-contained content.
- What is <figure> in HTML5?
The <figure> tag represents a unit of self-contained flow content.
- What is the use of Canvas element?
The canvas feature in HTML5 helps to build graphs, charts, bypass Photoshop to create the 2D images and place them into the HTML5 code.
- What are the new FORM elements in HTML5?
These functions are –
- <datalist> – It is use to specify a number of options for the input controls.
- <keygen> – It represents key-pair generator field.
- <output> – This represents the result of any scripting calculation.
- Tell me two benefits of HTML5 Web Storage
Benefits of HTML5 Web Storage:
- It can store up to 10 MB of data.
- Web storage data can’t be transferred with the HTTP request. It helps for increasing the application’s performance.
- What are the two types of Web Storage in HTML5?
Two storage types of HTML5:
- Session Storage
It can store current session data only. It means in the session storage the stored data clear automatically when the browser closed.
- Local Storage
In local storage, when the current browser window is closed, data is not deleted automatically.
- What is the Application Cache and why it is used in HTML5?
The Application Cache means that a web application is in cached state and one can access it without an internet connection.
Here, Some advantages of Application Cache:
- Offline browsing – Web users can also use the offline application without internet.
- Speed – Cached resources load quicker.
- Reduce the server load – Here, the web browser will only download updated resources from the server.
- Explain five new input types provided by HTML5 for forms?
Following are the new data types in HTML5:
- Date: This feature offers the user to select a date.
- Datetime-local: With this input type, the user can select a date and time without time zone.
- Datetime: With this input type, the user can select a date and time with time zone.
- Month: It allows the user to select a month and year.
- Email: This input type used to select an e-mail address.
Hope this article was helpful for you. Let us know if you have any feedback/suggestions for us in the comment section below.