Home  >  Article  >  Web Front-end  >  40 HTML5 interview questions (with answers)

40 HTML5 interview questions (with answers)

怪我咯
怪我咯Original
2017-05-07 11:52:023675browse

40 HTML5 interview questions (with answers)

Introduction

I am an ASP.NET MVC developer. Recently, when I was looking for a job, I was asked a lot of questions related to HTML5 and New features. So the following 40 important questions will help you review your HTML5 related knowledge.

These questions are not an efficient solution to getting you the job, but they can be helpful when you want to quickly review a related topic.

Happy job hunting.

40 HTML5 interview questions (with answers)

What is the relationship between SGML (Standard Generalized Markup Language) and HTML (Hypertext Markup Language), XML (Extensible Markup Language) and HTML?

SGML (Standard General Markup Language) is a standard that tells us how to specify document markup. It is a metalanguage that only describes how document markup should be, and HTML is a markup language described by SGML.

Therefore, SGML is used to create HTML references and DTDs that must be adhered to together. You will often find the "DOCTYPE" attribute at the head of the HTML page, which is used to define the target DTD used to parse

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">


Parsing SGML is a pain now, so XML was created to make things better. XML uses SGML, for example: in SGML you have to use start and end tags, but in XML you can have auto-closing end tags.

XHTML was created from XML and is used in HTML4.0. You can refer to the XML DTD shown in the code snippet below

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">



40 HTML5 interview questions (with answers)
##In short, SGML is the parent class of all types, Old HTML utilizes SGML, HTML4.0 uses XHTML, which is derived from XML


What is HTML5?

HTML5 is the latest HTML standard, its main goal is to provide all content without the need for any additional plug-ins like flash, silverlight, etc. These contents come from animation, video, rich GUI, etc.


HTML5 is a collaborative output between the World Wide Web Consortium (W3C) and the Web Hypertext Application Technology Working Group (WHATWG)


Why we don’t need DTD (Document Type Definition) in HTML5 Definition))?

HTML5 does not use SGML or XHTML. It is a brand new thing, so you do not need to refer to the DTD. For HTML5, you only need to place the following document type code to tell the browser to recognize that this is an HTML5 document



Will HTML5 still work if I don't put in ?

No, the browser will not recognize it as an HTML document, and the HTML5 tags will not work properly



Which browsers support HTML5?

Almost all browsers Safari, Chrome, Firefox, Opera, and IE support HTML5



What is the difference between the page structure of HTML5 and HTML4 or earlier HTML?

A typical WEB page includes a header, footer, navigation, center area, and sidebar. Now if we want to render this content in an HTML area in HTML4, we might want to use the p tag.


But in HTML5 by creating element names for these areas it makes them clearer and makes your HTML more readable


40 HTML5 interview questions (with answers)
The following is the structure of the page More details of HTML5 elements:

: Represents the header data of HTML

: The footer area of ​​the page


: Self-contained content

: Use internal articles to define areas or put grouped content into areas