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
After switching from Vue2's writing style to ...
There are many types of auto-increment IDs used i...
Note: This table is quoted from the W3School tuto...
This article shares with you the specific method ...
1. Download address https://dev.mysql.com/downloa...
Table of contents Preface Generation of redo log ...
The three-dimensional column chart consists of th...
describe: When the Tabs component switches back a...
This article example shares the specific code of ...
This article shares the specific code of writing ...
Tomcat accesses the project, usually ip + port + ...
Part 1: Basics 1. Unlike pseudo-classes such as :...
Examples: Through the PHP background code, you ca...
Environment Introduction: Ubuntu Server 16.04.2+M...
1. Add the ul tag in the body first <!-- Unord...