Common Convention Tags Self-closing tags, no need to be closed (for example: img input br hr, etc.); XML/HTML CodeCopy content to clipboard
Class and ID Classes should be named after their function or content, not their presentation. XML/HTML CodeCopy content to clipboard
Attribute Order HTML attributes should appear in a specific order to ensure readability. id XML/HTML CodeCopy content to clipboard
quotation marks Double quotes are used uniformly in attribute definitions. XML/HTML CodeCopy content to clipboard
bNested a does not allow div to be nested. This constraint belongs to semantic nesting constraint. Different from it is strict nesting constraint, for example, a does not allow a to be nested. Strict nesting constraints are not allowed in all browsers; while semantic nesting constraints are mostly handled by browsers with tolerance, and the generated document trees may be different from each other. Semantic nesting constraints <li> is used under <ul> or <ol>;
inline-Level elements can only contain text or other inline-Level elements; Boolean properties In the HTML5 specification, attributes such as disabled, checked, and selected do not need to be set with values. XML/HTML CodeCopy content to clipboard
Semantic Normally, each label has semantics. The so-called semantics means that your clothes are divided into coats, pants, skirts, underwear, etc., each with corresponding functions and meanings. So you can't put your underwear around your neck. -- A trace In addition, the semantic HTML structure helps machines (search engines) understand it, and when multiple people collaborate, they can quickly understand the developer's intentions. Common tag semantics
Example Think of the page you build as a book, with the semantics of the tags corresponding to their functions and meanings; Book title: <h1> HEAD Adding a standards mode declaration to the first line of every HTML page ensures consistent behavior in every browser. XML/HTML CodeCopy content to clipboard
Character encoding Use utf-8 encoding without BOM as the file format; XML/HTML CodeCopy content to clipboard
IE compatibility mode Give priority to using the latest versions of IE and Chrome kernel. XML/HTML CodeCopy content to clipboard
SEO Optimization XML/HTML CodeCopy content to clipboard
viewport Viewport: generally refers to the size of the browser window content area, excluding toolbars, tabs, etc. XML/HTML CodeCopy content to clipboard
iOS Icons The apple-touch-icon image is automatically processed with rounded corners and highlights; XML/HTML CodeCopy content to clipboard
favicon When no favicon is specified, most browsers will request favicon.ico in the root directory of the Web Server. To ensure that the favicon is accessible and avoid 404, you must follow one of the following two methods: Place the favicon.ico file in the Web Server root directory; XML/HTML CodeCopy content to clipboard
HEAD Template XML/HTML CodeCopy content to clipboard
HTML Comments Module comments XML/HTML CodeCopy content to clipboard
|
<<: Detailed explanation of global parameter persistence in MySQL 8 new features
>>: Introduction to Sublime Text 2, a web front-end tool
Table of contents 1. Write Webshell into outfile ...
Many times, after we install a web service applic...
Recently, there have been many database-related o...
Table of contents 1. Ternary operator judgment 2....
<br />This is an article I collected a long ...
For historical reasons, MySQL replication is base...
MySQL5.6.40 installation process under CentOS7 64...
This article example shares the specific code for...
Use runlike to view the docker run startup parame...
Through permission-based email marketing, not onl...
The layui table has multiple rows of data. Throug...
<br />When uploading on some websites, a [Se...
Table of contents 1. Download JDK (take jdk1.8.0 ...
Preface: In Vue, props can be used to connect ori...
Recently, I have a need to list all host names in...