HTML part

  • What does DOCTYPE do? How to write?
1. The definition of document type is a set of pseudo-classes for data exchange between programs and the establishment of grammar rules on identifiers can be compared with the document and document type definition file to check whether the document conforms to the specification, whether the use of elements and tags is correct. 2. In standard mode, the browser renders the page to the highest standards it supports. In promiscuous mode, the page is displayed with a looser backward compatibility approach. Promiscuous mode usually simulates the behavior of older browsers in case the old site doesn't work. 3 Mode triggers the browser to choose which rendering method to use depending on whether the DOCTYPE exists and which DTD it is using. <DOCTYPE HTML >Copy the code
  • List common tags and briefly describe the scenarios in which they are used.
<a href="http://www.baidu.com"> for hyperlinks <article> for an article <aside> for the sidebar of the page <blockquote> for large sections of reference content <br> Newline <code> for wrapping a piece of code content < DD > is a description of a DT noun for a DL list. <del> is used to remove unwanted text. <footer> is used to wrap the bottom content of the page. <header> Is used to wrap the header content of the page <meta>,<link>,<title> <form> is used to make a form,< iframe> is used to nest another small page into a page, and <textarea> is used to make a large text input fieldCopy the code
  • Garbled characters appear on the page, what is going on? How to solve it?
The web wheel usually happens because web developers don't code their web pages according to specifications, <meta http-equiv=" content-type "Content ="text/ HTML "; charset=utf-8"/>Copy the code
  • What are the effects of the title and Alt attributes?
The difference between the Alt attribute and the title attribute is that the Alt attribute displays the value only when the image cannot be loaded, while the title attribute displays the value when the image is loadedCopy the code
  • Data – What does the property do?
Data - Provides the front-end developer with a custom set of properties that can be retrieved from the dataset property of the object or from the getAttribute method for browsers that do not support this propertyCopy the code
  • What are Web standards and W3C standards?
The label letters must be lowercase and the double labels must be closed. Labels cannot be nested arbitrarily. Try to use external style and external chain JS, make structure, presentation, behavior into three pieces, this can improve the page rendering speed. Style as little as possible to use inline style, ID and class name to do not need to change the page content, you can provide printed version, do not need to provide copy content, improve the site usabilityCopy the code
  • How do you understand HTML semantics?
Simply put: Do the right thing with the right label. For example: Header: Header Navigation: nav Main Content: main Title: H1 ~ H6 Paragraph: p Sidebar: aside footer: footerCopy the code
  • What’s the difference between POST and GET?
1. Different functions get obtains data from the server. Post transfers data to the server. 2. Different processes GET writes parameters after URL addresses. The value cannot exceed 2KB. A large amount of data is transmitted through post. 4 different security get security is very lowCopy the code
  • What does name do in input?
The name attribute is used to identify form data submitted to the server. Only when the name attribute is set in the form form can the submitted form values be retrievedCopy the code
  • Common Web security and Defense Principles?
Cross-domain request forgery (posing as a user to initiate a request, the user does not know the situation, to complete some requests against the user's will), resulting in CSRF attack defense: the server CSRF method, is to add pseudo-random number in the client page, through the method of verification codeCopy the code