Summary of all HTML interview questions

Summary of all HTML interview questions

1. The role of doctype, the difference between strict and mixed mode, and what is its significance

1. Syntax format: <!DOCTYPE html>

2. <!DOCTYPE> is not an Html tag, but an instruction that tells the browser which HTML version to use to write this page

3. There are three modes in HTML 4.01:

1. HTML 4.01 Strict strict mode does not include presentational elements ( tags that are purely for page display, such as b, font, etc., because these have corresponding alternatives in CSS ) and deprecated elements, such as font, and does not allow framesets;

2. HTML 4.01 Transitional filter mode, including presentational and deprecated elements, but not framesets;

3. HTML 4.01 Frameset loose mode, including display and deprecated elements, and also framesets;

4. There are four modes in xhtml:

1. XHTML 1.0 Strict mode does not include presentational and deprecated tags, does not allow framesets, and strictly writes tags in XML format;

2. XHTML 1.0 Transitional filter mode, including presentational and deprecated tags, does not allow framesets, and strictly writes tags in XML format;

3. XHTML 1.0 Frameset loose mode, including presentation and deprecation tags, allowing framesets, and strictly writing tags in XML format;

4. XHTML 1.1 is equivalent to XHTML 1.0 strict, but allows the addition of models.

5. The difference between standard mode and mixed mode

1. These two modes are mainly refined by browser manufacturers. In standard mode, the browser will present the page according to the specification, while in promiscuous mode, the browser will present it in a backward compatible way;

2. Mozilla and Safari use "almost standards mode", which means there are slight differences in the way they handle tables;

3. The biggest problem is IE's box rendering mechanism, which includes border-box (weird mode) and content-box.

6. How to trigger promiscuous mode

1. HTML 4.01 documents, if they contain transitional (filter) DTD but no URI, are rendered in promiscuous mode;

2. If there is no <!DOCTYPE> tag in xhtml or html, mixed mode rendering is used

2. Why does HTML5 only need to write <!DOCTYPE HTML>

The main reason is that there is only one document type in HTML5, which is HTML, unlike HTML 4.01 or XHTML1.0 which have multiple document types.

3. Inline elements, block-level elements, and empty elements

1. Inline elements: span, a, em (emphasis), label, textarea, select, sub, sup, etc.

2. Block-level elements: div, ul, ol, li, h1~h6, table, form, p, dl, dd, dt, etc.

3. Empty elements: br, hr

4. The difference between link and @import import styles

1. There are three ways to reference CSS in HTML pages: style tags within the page, link external links, and @import imports.

2. link is an xhtm tag, which not only links to css, but also to rss services, while @import can only be css

3. The link external link file will be loaded synchronously with the document, while @import will wait until the document is loaded before loading.

4. Link has no compatibility issues, but @import is in the CSS 2.1 specification and is not supported by lower version browsers.

5. Link supports using js to control the style of DOM elements, while @import does not (that is, you can use javascript to operate the link tag to change the css document to achieve the effect of changing the skin, but @import does not work)

XML/HTML CodeCopy content to clipboard
  1. < style >   
  2. @import url('test.css');
  3.      </ style >   

The above summary of HTML interview questions is all I want to share with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM.

Original URL: http://www.cnblogs.com/cqhaibin/archive/2016/07/24/5701943.html

<<:  How to use Web front-end vector icons

>>:  Vue codemirror realizes the effect of online code compiler

Recommend

Summary of the top ten problems of MySQL index failure

Table of contents background 1. The query conditi...

MySQL table type storage engine selection

Table of contents 1. View the storage engine of t...

CSS3 property line-clamp controls the use of text lines

Description: Limit the number of lines of text di...

Three useful codes to make visitors remember your website

Three useful codes to help visitors remember your...

How to build a MySQL high-availability and high-performance cluster

Table of contents What is MySQL NDB Cluster Preli...

Detailed explanation of the use of Vue.js render function

Vue recommends using templates to create your HTM...

Record a slow query event caused by a misjudgment of the online MySQL optimizer

Preface: I received crazy slow query and request ...

Why does using limit in MySQL affect performance?

First, let me explain the version of MySQL: mysql...

Example of how to upload a Docker image to a private repository

The image can be easily pushed directly to the Do...

Teach you how to use docker-maven-plugin to automate deployment

1. Introduction to docker-maven-plugin In our con...

Analysis of the Principle and Method of Implementing Linux Disk Partition

remember: IDE disk: the first disk is hda, the se...

A method of making carousel images with CSS3

Slideshows are often seen on web pages. They have...

The difference between ENTRYPOINT and CMD in Dockerfile

In the Docker system learning tutorial, we learne...