search
HomeWeb Front-endHTML TutorialCommonly used meta organization

The

tag provides metadata about the HTML document. The metadata is not displayed on the page, but is machine-readable. It can be used by browsers (how content is displayed or pages are reloaded), search engines (keywords), or other web services.

 Required attributes

Property Value Description
content some text Define meta-information related to http-equiv or name attribute

 Optional attributes

Property Value Description
http-equiv content-type/expire/refresh/set-cookie Associate the content attribute to the HTTP header.
name author/description/keywords/generator/revised/others Associate the content attribute to a name.
content some text Define the format used to translate content attribute values.

 SEO optimization

 Reference documentation

  • Page Keywords, each web page should have a unique set of keywords that describe the content of that web page.
    Use descriptive and representative keywords and phrases that people are likely to search for, and accurately describe the information provided on the page. Mark content that is too short and search engines may not consider it relevant. Also tags should not exceed 874 characters.
<meta name="keywords" content="your tags">
  • Page Description, each web page should have a description tag that is no longer than 150 characters and accurately reflects the content of the web page.
<meta name="description" content="150 words">
  • Search engine indexing method, robotterms is a set of values ​​separated by commas (,), usually with the following values: none, noindex, nofollow, all, index and follow. Make sure to use the nofollow and noindex attribute values ​​correctly.
<meta name="robots" content="index,follow">
<!--
    all:文件将被检索,且页面上的链接可以被查询;
    none:文件将不被检索,且页面上的链接不可以被查询;
    index:文件将被检索;
    follow:页面上的链接可以被查询;
    noindex:文件将不被检索,但页面上的链接可以被查询;
    nofollow:文件将不被检索,页面上的链接可以被查询。
 -->
  • Page redirection and refresh: The number in the content represents the time (seconds), that is, how long it takes to refresh. If you add a url, it will redirect to the specified web page (search engines can automatically detect it, and it can easily be regarded as misleading by the engine and be punished).
<pre class="brush:html;toolbar:false"><meta http-equiv="refresh" content="0;url=">
  • Others
<meta name="author" content="author name"> <!-- 定义网页作者 -->
<meta name="google" content="index,follow">
<meta name="googlebot" content="index,follow">
<meta name="verify" content="index,follow">

 Mobile devices

  • viewport: Can optimize the display of mobile browsers. If the website is not responsive, do not use initial-scale or disable scaling.
    The viewport width of most 4.7-5-inch devices is set to 360px; 5.5-inch devices are set to 400px; iphone6 ​​is set to 375px; iphone6 ​​plus is set to 414px.
<meta name="viewport" content="width=device-width; initial-scale=1.0;maximum-scale=1.0; user-scalable=no;">
<!-- `width=device-width` 会导致 iPhone 5 添加到主屏后以 WebApp 全屏模式打开页面时出现黑边  -->
  1. width: width (number / device-width) (range from 200 to 10,000, default 980 pixels)
  2. height: height (numeric value / device-height) (range from 223 to 10,000)
  3. initial-scale: initial scaling (ranging from >0 to 10)
  4. minimum-scale: The minimum ratio the user is allowed to zoom to
  5. maximum-scale: The maximum ratio the user is allowed to zoom to
  6. user-scalable: whether the user can manually shrink (no,yes)
  7. minimal-ui: You can minimize the upper and lower status bars when the page loads. (deprecated)

 Note that many people use initial-scale=1 on non-responsive websites, which causes the website to render at 100% width and the user needs to manually move the page or zoom. If user-scalable=no or maximum-scale=1 is used together with initial-scale=1, the user will not be able to zoom in/out the web page to see the entire content.

  • WebApp full screen mode: Disguise app, offline application.
<meta name="apple-mobile-web-app-capable" content="yes"> <!-- 启用 WebApp 全屏模式 -->
  • Hide status bar/set status bar color: Only takes effect when WebApp full screen mode is turned on. The value of content is default | black | black-translucent.
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  • Title after adding to home screen
<meta name="apple-mobile-web-app-title" content="标题">

Commonly used meta organizationCommonly used meta organizationCommonly used meta organization

  • Ignore numbers and automatically recognize them as phone numbers
<meta content="telephone=no" name="format-detection"> 
  • Ignore identifying email
<meta content="email=no" name="format-detection">
  • Add Smart App Banner Smart App Banner: Tell the browser the app corresponding to this website, and display the download banner on the page (as shown below). Reference documentation
<meta name="apple-itunes-app" content="app-id=myAppStoreID, affiliate-data=myAffiliateData, app-argument=myURL"> 

![Alt text](./IMG_3701.jpg)

  • Other Reference documents
<!-- 针对手持设备优化,主要是针对一些老的不识别viewport的浏览器,比如黑莓 -->
<meta name="HandheldFriendly" content="true">
<!-- 微软的老式浏览器 -->
<meta name="MobileOptimized" content="320">
<!-- uc强制竖屏 -->
<meta name="screen-orientation" content="portrait">
<!-- QQ强制竖屏 -->
<meta name="x5-orientation" content="portrait">
<!-- UC强制全屏 -->
<meta name="full-screen" content="yes">
<!-- QQ强制全屏 -->
<meta name="x5-fullscreen" content="true">
<!-- UC应用模式 -->
<meta name="browsermode" content="application">
<!-- QQ应用模式 -->
<meta name="x5-page-mode" content="app">
<!-- windows phone 点击无高光 -->
<meta name="msapplication-tap-highlight" content="no">
  • Declare encoding
<meta charset="utf-8">
  • Prioritize using the latest version of IE and Chrome
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<!-- 关于X-UA-Compatible -->
<meta http-equiv="X-UA-Compatible" content="IE=6"><!-- 使用IE6 -->
<meta http-equiv="X-UA-Compatible" content="IE=7"><!-- 使用IE7 -->
<meta http-equiv="X-UA-Compatible" content="IE=8"><!-- 使用IE8 -->
  • Browser kernel control: Many domestic browsers have dual kernels (webkit and Trident). The webkit kernel allows high-speed browsing, and the IE kernel is compatible with web pages and old versions of websites. Websites that add meta tags can control which kernel rendering the browser chooses. Reference documentation
 <meta name="renderer" content="webkit|ie-comp|ie-stand">

The default kernel mode of domestic dual-core browsers is as follows:

 1. Sogou high-speed browser, QQ browser: IE kernel (compatibility mode)

 2. 360 Speed ​​Browser, Aoyou Browser: Webkit kernel (speed mode)

  • Prohibit the browser from accessing page content from the local computer’s cache: With this setting, visitors will not be able to browse offline.
<meta http-equiv="Pragma" content="no-cache">
  • Windows 8
<meta name="msapplication-TileColor" content="#000"> <!-- Windows 8 磁贴颜色 -->
<meta name="msapplication-TileImage" content="icon.png"> <!-- Windows 8 磁贴图标 -->
  • Site Adaptation: Mainly used for PC-mobile page correspondence.
<meta name="mobile-agent" content="format=[wml|xhtml|html5]; url=url">
<!--
[wml|xhtml|html5]根据手机页的协议语言,选择其中一种;
url="url" 后者代表当前PC页所对应的手机页URL,两者必须是一一对应关系。
 -->
  • Transcoding statement: Opening a webpage with Baidu may cause it to be transcoded (such as posting advertisements). To avoid transcoding, you can add the following meta
<meta http-equiv="Cache-Control" content="no-siteapp">

Please click here to read the original text

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
The Future of HTML, CSS, and JavaScript: Web Development TrendsThe Future of HTML, CSS, and JavaScript: Web Development TrendsApr 19, 2025 am 12:02 AM

The future trends of HTML are semantics and web components, the future trends of CSS are CSS-in-JS and CSSHoudini, and the future trends of JavaScript are WebAssembly and Serverless. 1. HTML semantics improve accessibility and SEO effects, and Web components improve development efficiency, but attention should be paid to browser compatibility. 2. CSS-in-JS enhances style management flexibility but may increase file size. CSSHoudini allows direct operation of CSS rendering. 3.WebAssembly optimizes browser application performance but has a steep learning curve, and Serverless simplifies development but requires optimization of cold start problems.

HTML: The Structure, CSS: The Style, JavaScript: The BehaviorHTML: The Structure, CSS: The Style, JavaScript: The BehaviorApr 18, 2025 am 12:09 AM

The roles of HTML, CSS and JavaScript in web development are: 1. HTML defines the web page structure, 2. CSS controls the web page style, and 3. JavaScript adds dynamic behavior. Together, they build the framework, aesthetics and interactivity of modern websites.

The Future of HTML: Evolution and Trends in Web DesignThe Future of HTML: Evolution and Trends in Web DesignApr 17, 2025 am 12:12 AM

The future of HTML is full of infinite possibilities. 1) New features and standards will include more semantic tags and the popularity of WebComponents. 2) The web design trend will continue to develop towards responsive and accessible design. 3) Performance optimization will improve the user experience through responsive image loading and lazy loading technologies.

HTML vs. CSS vs. JavaScript: A Comparative OverviewHTML vs. CSS vs. JavaScript: A Comparative OverviewApr 16, 2025 am 12:04 AM

The roles of HTML, CSS and JavaScript in web development are: HTML is responsible for content structure, CSS is responsible for style, and JavaScript is responsible for dynamic behavior. 1. HTML defines the web page structure and content through tags to ensure semantics. 2. CSS controls the web page style through selectors and attributes to make it beautiful and easy to read. 3. JavaScript controls web page behavior through scripts to achieve dynamic and interactive functions.

HTML: Is It a Programming Language or Something Else?HTML: Is It a Programming Language or Something Else?Apr 15, 2025 am 12:13 AM

HTMLisnotaprogramminglanguage;itisamarkuplanguage.1)HTMLstructuresandformatswebcontentusingtags.2)ItworkswithCSSforstylingandJavaScriptforinteractivity,enhancingwebdevelopment.

HTML: Building the Structure of Web PagesHTML: Building the Structure of Web PagesApr 14, 2025 am 12:14 AM

HTML is the cornerstone of building web page structure. 1. HTML defines the content structure and semantics, and uses, etc. tags. 2. Provide semantic markers, such as, etc., to improve SEO effect. 3. To realize user interaction through tags, pay attention to form verification. 4. Use advanced elements such as, combined with JavaScript to achieve dynamic effects. 5. Common errors include unclosed labels and unquoted attribute values, and verification tools are required. 6. Optimization strategies include reducing HTTP requests, compressing HTML, using semantic tags, etc.

From Text to Websites: The Power of HTMLFrom Text to Websites: The Power of HTMLApr 13, 2025 am 12:07 AM

HTML is a language used to build web pages, defining web page structure and content through tags and attributes. 1) HTML organizes document structure through tags, such as,. 2) The browser parses HTML to build the DOM and renders the web page. 3) New features of HTML5, such as, enhance multimedia functions. 4) Common errors include unclosed labels and unquoted attribute values. 5) Optimization suggestions include using semantic tags and reducing file size.

Understanding HTML, CSS, and JavaScript: A Beginner's GuideUnderstanding HTML, CSS, and JavaScript: A Beginner's GuideApr 12, 2025 am 12:02 AM

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function