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
Today, it suddenly occurred to me that it would be...
This article uses examples to illustrate the prin...
1. Introduction Git is a free, open source distri...
In the latest HTML standard, there is a calc CSS e...
Table of contents Pull a centos image Generate ng...
1. Background that needs to be passed through CSS...
On a whim, I wrote a case study of a small ball b...
In MySQL, you may encounter the problem of case s...
1. Application of multimedia in HTML_falsh animat...
If you are using the latest Ubuntu Server version...
This article shares the summary of the JS mineswe...
1. The significance of building nexus service As ...
When writing a Dockerfile, include an entrypoint ...
Preface In terms of layout, Gobang is much simple...
Preface Linux does not have a prominent Recycle B...