MIP verification rules
MIP verification rules
The MIP page will have strict standard verification, and no problems that fail the verification are allowed.
MIP verification tool address:
This document is intended to help developers find the content and rules of verification and quickly locate the reasons for failed verification
MIP HTML tags and attribute errors
1. Missing mandatory tags
##In MIP HTML, mandatory tags include:P.S.: When the meta tag name="viewport" is used, the value of content must contain at least width=device-width, minimum-scale=1 and initial-scale=1. Properties and the order is not fixed. 2. Disabled tagsMost HTML tags are allowed to be used. For tags that are disabled or need to be replaced, please refer to:
MIP HTML Specification
- a: The href attribute does not allow the use of javascript: protocol,
- a: The target attribute needs to be set to
_blank
- mip-img
- src: must be a url
- mip-pix
- src: must be an address url that supports https. If you choose the https proxy provided by Baidu Cloud, the url should contain "t={TIME}&title= {TITLE}&host={HOST}&from=baidu"
- Other basic HTML page attribute specifications remain unchanged
1. The url in MIP HTML is forced to be https
2.
<a>
Tag:-
<a href="javascript:xxx()"></a>
wrong-
<a href="//m.sbmmt.com/m/html5/xxx" target="_blank"></a>
Right4 .Invalid value of attribute value
Invalid value of attribute value may occur:
<meta name ="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
- width attribute value device-width
- initial-scale attribute value 1
#<script type="application/ld+json"></script>
- ##<script type="application/json"></script>
In addition to the js required for external link MIP , the type attribute value of the script tag should be application/ld+json or application/json 1. Except for the values given above, all Invalid value
For example, mip-img and mip-pix in mip html have mandatory attributes src:
mip-img
- src
- mip-pix
src
Some tags have specified direct parent tags. The following example gives the direct parent tag that each tag must have:
- !doctype's direct parent tag is root
- head's direct parent tag is html## The direct parent tag of
- #body is html
- The direct parent tag of link is head## The direct parent tag of #meta
- is head## The direct parent tag of style mip-custom is
- The direct parent tag of headstyle is
- boilerplate7. Illegal parent tag
For example: The sub-tag of
<body>- is written in
- <head>
8. Force parent tag
img must be a child tag of noscript
- video must be a child of noscript Level tag audio must be a child tag of noscript
- When noscript is used in head, it must be the last child node of head , there are no restrictions on noscript in the body
- 9. Duplicate unique tags
In a piece of html, some tags are unique , that is to say, it can only appear once. When there are duplicate unique tags in the html, an error should be reported.
The following is a list of unique tags:- <doctype html>
##<head>
##<link rel= "canonical" href=...>
##<meta charset="utf-8">
<meta viewport>
##<style mip-custom>
<body>