search
HomeWeb Front-endHTML TutorialDetailed explanation of meta tags and usage in html

Detailed explanation of meta tags and usage in html

Feb 24, 2018 am 09:32 AM
htmlmetaDetailed explanation

The

<meta> element provides meta-information about the page, such as description and keywords for search engines and update frequency. This article mainly introduces to you the detailed explanation of meta tags and usage in HTML. Friends who are interested should take a look at it. I hope it can help you.

meta tag in Html

1. Meaning of meta tag

The <meta> element can provide meta-information about the page, such as for search engines and Description and keywords for update frequency.

 The <meta> tag is located at the head of the document and does not contain any content.

 The <meta> attribute of the tag defines the name/value pairs associated with the document.

2. Commonly used attributes in meta

1. charset (character set)

Description: Specifies the character encoding of HTML documents.

Usage:

2. viewport

Description: It is the visible area of ​​the user's web page. As we all know, mobile device screens are generally much smaller than PCs. WebKit browsers will map a larger "virtual" window to the mobile device screen. The default virtual window is 980 pixels wide (the current standard for most websites). width) and then scale according to a certain ratio (3:1 or 2:1).

That is to say, when we load an ordinary web page, webkit will first load the web page with the browser standard of 980 pixels, and then reduce it to a width of 490 pixels. Note that this reduction is a global reduction, that is, all elements on the page will be reduced.

Usage:

<meta>

   (1) width

  width controls the size of the viewport, generally set to device-width

for adaptive purposes    (2) initial -scale

    Initial-scale: The initial scaling ratio, that is, the scaling ratio when the page is loaded for the first time.

      (3) maximum-scale

     Maximum-scale Maximum zoom. That is, the maximum zoom allowed. This is also a floating point value indicating the maximum multiplier of the page size compared to the screen size.

    (4) minimum-scale

    minimum-scale: The minimum ratio to which the user is allowed to zoom. Similar to maximum-scale usage.

    (5) user-scalable

     user-scalable User-adjustable scaling. That is, whether the user can change the zoom level of the page. If set to yes, the user is allowed to change it, otherwise it is no.

3. keywords (keywords)

Description: A list of keywords provided for search engines. Separate each keyword with an English comma ",". Specify keywords that search engines use to improve search quality.

Usage:

4. description ( Description, introduction)

  Description: Description is used to tell search engines the main content of your website.

Usage:

5. format-detection (format detection)

Explanation: format-detection is used to detect some formats in html.

Usage: The format-detection attribute of meta mainly has the following settings:

 meta name="format-detection" content="telephone=no"
    meta name="format-detection" content="email=no"
    meta name="format-detection" content="adress=no"

It can also be written consecutively: meta name="format-detection" content="telephone= no,email=no,adress=no"    

                                       
   

##                               she is a string of numbers without adding a link style, and the iPhone will automatically Add a link style to this text, and clicking on this number will automatically dial the number! How to remove this dial-up link? At this time, our meta should show its magic again. The code is as follows:

Telephone=no prohibits converting numbers into dial-up links!

Telephone=yes turns on the conversion of numbers into dial-up links. To turn on the conversion function, there is no need to write this meta. It is turned on by default!

                           

#                 

##    2) Email

   Tell the device not to recognize the email address, and not automatically send it after clicking it


   Email=no is prohibited as an email address!

If email=yes is turned on, the text will default to the email address. There is no need to write this meta. It is turned on by default!

    (3)adress


  adress=no prohibits jumping to the map!

  adress=yes turns on the function of clicking on the address to jump directly to the map. It is turned on by default!

6. apple-touch-fullscreen

Description: After adding to the home screen, it will be displayed in full screen.

Usage:

7. apple-mobile-web-app-capable###

 Description: The function is to delete the default Apple toolbar and menu bar. content has two values ​​"yes" and "no". When we need to display the toolbar and menu bar, there is no need to add this line of meta. The default is to display it.

Usage:

8. App-Config

Description :Retain history records and animation effects

Usage:

9 . msapplication-tap-highlight

Description: Click without highlight (highlight)

Usage:

Related recommendations:

How to implement the viewport in the meta tag to control the css attributes of the device screen

HTML meta tag usage Summary

Introduction to common uses of HTML meta tags

The above is the detailed content of Detailed explanation of meta tags and usage in html. For more information, please follow other related articles on the PHP Chinese website!

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

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment