In HTML5 specifications, attributes such as disabled, checked, and selected do not need to set values.
XML/HTML CodeCopy content to clipboard
- <input type="text" disabled>
-
-
<input type="checkbox" value="1" checked>
-
-
<select>
-
<option value="1" selected>1option>
-
select>
Normally, each tag has semantic meaning. The so-called semantic meaning is that your clothes are divided into jackets, pants, skirts, underwear, etc., each with corresponding functions and meanings. So you can't put underwear around your neck. -- A trace of
In addition, the semantic HTML structure helps machines (search engines) understand. On the other hand, when multiple people collaborate, they can quickly understand the developer's intentions.
Treat the page you build as a book, and map the semantics of tags to their functions and meanings;
Add a standard mode declaration to the first line of each HTML page to ensure consistent performance in each browser.
XML/HTML CodeCopy content to clipboard
- >
- Language attribute
-
-
-
<html lang="zh- Hans">
-
-
-
<html lang="zh- cmn-Hans">
-
-
-
<html lang="zh- cmn-Hant">
-
-
-
<html lang="en" >
XML/HTML CodeCopy content to clipboard
- <html>
-
<head>
-
<meta charset="utf- 8">
- …
-
head>
-
<body>
- …
-
body>
-
html>
Prioritize using the latest versions of IE and Chrome kernels.
XML/HTML CodeCopy content to clipboard
- <meta http-equiv="X-UA -Compatible" content="IE=edge,chrome=1">
XML/HTML CodeCopy content to clipboard
- <head>
-
<meta charset="utf- 8">
" " 🎜>-
<title>Style Guidetitle>
-
<
- meta name="keywords" content="your keywords">
-
<meta name="description" content="your description">
-
<meta name="author" content="author,email address">
-
head>
viewport
viewport: generally refers to the size of the content area of the browser window, excluding toolbars, tabs, etc.; width: browser width, the width of the visible area of the page in the output device; device- width: device resolution width, visible width of the screen of the output device; initial-scale: initial scaling ratio; maximum-scale: maximum scaling ratio;
optimized for mobile devices, set the width of the visible area and initial scaling. -
XML/HTML CodeCopy content to clipboard
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
iOS icon
apple-touch-icon pictures are automatically processed into rounded corners and highlights;
apple-touch-icon-precomposed prohibits the system from automatically adding effects and directly displays the original design;
XML/HTML CodeCopy content to clipboard
-
-
<link rel="apple- touch-icon-precomposed" href="/apple-touch-icon-57x57-precomposed.png">
-
-
-
<link rel="apple- touch-icon-precomposed" href="/apple-touch-icon-72x72-precomposed.png" sizes="72x72">
-
-
-
<link rel="apple- touch-icon-precomposed" href="/apple-touch-icon-114x114-precomposed.png" sizes="114x114">
-
-
-
<link rel="apple- touch-icon-precomposed" href="/apple-touch-icon-144x144-precomposed.png" sizes="144x144">
favicon
When favicon is not specified, most browsers will request favicon.ico in the root directory of the Web Server. In order to ensure that the favicon is accessible and avoid 404, one of the following two methods must be followed:
Place the favicon.ico file in the root directory of the Web Server;
Use link to specify the favicon;
XML/HTML CodeCopy content to clipboard
- <link rel="shortcut icon" href="path/to/favicon.ico">
HEAD Template
XML/HTML CodeCopy content to clipboard
- >
-
<html lang="zh-cmn-Hans">
-
<head>
-
<meta charset="utf-8">
-
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
-
<title>Style Guidetitle>
-
<meta name="description" content="不超过150个字符">
-
<meta name="keywords" content="">
-
<meta name="author" content="name, email@gmail.com">
-
-
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-
-
<link rel="apple-touch-icon-precomposed" href="/apple-touch-icon-57x57-precomposed.png">
-
-
<링크 rel="대체" 유형="application/rss xml" 제목="RSS" href="/rss.xml" />
-
<링크 rel="바로가기 아이콘 " href="path/to/favicon.ico">
-
머리>
HTML 주석
모듈 설명
XML/HTML 코드클립보드에 콘텐츠 복사
-
-
<div class="article- 목록">
- ...
-
div>
- 댓글 차단
-