Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

2021 HTML WEB front-end interview questions and answers


May 31, 2021 Article blog



Hello hello hello everyone, I am w3cschool programming lion, today to share with you 10 HTML WEB front-end interview questions and answers.

-----------------------------------------------------------------------------------------------------------------------------------------

1. What is HTML

HTML is HTML (hypertext markup language). I t is a language for building and displaying content for the World Wide Web, which is the core technology of the Internet.

Another W3C personal gathering of WHATWG (Web Hypertext Application Technology Working Group) concluded that W3C had not seriously considered the real improvement needs of the current dialect and that it had begun to address the new determination of HTML-HTML5. H tml5 is therefore another adaptation of HTML 4.01 and XHTML 1.0, focusing on the need for Web application designers and tending to address issues found in current details.

-----------------------------------------------------------------------------------------------------------------------------------------

2. What is HTML semantics and what are the benefits?

Helps with well-structured HTML structures

Help search engine indexing, crawling, is conducive to SEO

It is beneficial to the analysis of different devices

Good for the team's development and maintenance

-----------------------------------------------------------------------------------------------------------------------------------------

3, why add a < at the beginning of the html file! D OCTYPE html>

Tells the browser which version of the HTML specification to use to render the document. D oCTYPE does not exist or is not in the correct form, causing HTML documents to be rendered in mixed mode.

-----------------------------------------------------------------------------------------------------------------------------------------

4, HTML5 why only need to write <! D OCTYPE html>

(1) HTML5 is not based on SGML and therefore does not require a reference to DTD, but requires DOCTYPE to regulate

The behavior of fan browsers (let them run the way they should);

(2) HTML4.01 is based on SGML, so a reference to DTD is required to let the browser know the type of document used by the document.

-----------------------------------------------------------------------------------------------------------------------------------------

5, HTML5's new features

Content elements: article (stand-alone structure), footer (bottom), header (head), nav (navigation), section (segment).

Form controls: calendar, date, time, email, url, search.

Control elements: webworker, websockt, geolocation.

Form properties: placehoder, required, min, max

The removed elements are as follows:

Appearance layer elements: basefont, big, center, font, s, strike, tt, u.

Poor performance elements: frame, frameset, noframe

New elements include paint canvas, video (video) and audio elements for media playback, stored offline locally

LocalStorage stores data for a long time, and the data is not lost after the browser is closed, while the sessionStorage data is in liu

The reader is automatically deleted when it is turned off.

New technologies: canvas, svg, webworker, websocket, geolocation

-----------------------------------------------------------------------------------------------------------------------------------------

6, divtextarea

The contenteditable property, with a value of Boolean, can be edited when true. c ontrarily

-----------------------------------------------------------------------------------------------------------------------------------------

7, web standards and w3c understanding and understanding

Label closure, label lowercase, non-garbled nesting, increased search robot search chances, separation of structure behavior using chain css and js scripts,

File downloads and pages are faster, content can be accessed by more users, content can be accessed by a wider range of devices, and less code and components.

Easy to maintain, easy to change, do not need to change the content of the page, provide a printed version without the need to copy the content, improve the ease of use of the website.

-----------------------------------------------------------------------------------------------------------------------------------------

8, the difference between XHTML and HTML

The top of the document doctype declaration is different, xhtml doctype top statement clearly defines the writing of xhtml DTD;

html elements must be nested correctly and not messy;

The property must be lowercase;

Property values must be quoted;

Labels must have an end, and single labels should end with "/";

-----------------------------------------------------------------------------------------------------------------------------------------

9, iframe's role

Usage: Insert a third-party page into a web page to avoid repeated downloads when switching pages

Pros: Easy to modify, module separation

Cons: (1) iframe is created 1-2 orders of magnitude slower than a typical DOM element

(2) blocking the loading of the page

(3) Unfriendly to SEO

-----------------------------------------------------------------------------------------------------------------------------------------

10, Web Standards and W3C understanding and understanding

Label closure, label lowercase, non-garbled nesting, increased search robot search chances, separation of structure behavior using chain css and js scripts,

File downloads and pages are faster, content can be accessed by more users, content can be accessed by a wider range of devices, and less code and components.

Easy to maintain, easy to change, do not need to change the content of the page, provide a printed version without the need to copy the content, improve the ease of use of the website.