Header usage specification
Start tag usage <! Doctype html>
The html tag must be tagged with mip, that is,
Must contain
The head label must contain the character set Declaration <meta charset = "utf-8">. The character set must be UTF-8.
The head label must contain the viewport setting label: <meta name = "viewport" content = "width = device-width, initial-scale = 1">, recommended include minimum-scale = 1
The head label must contain <link rel = "stylesheet" type = "text/css" href = "https://mipcache.bdstatic.com/static/v1/mip.css">
The body tag must contain <script src = "https://mipcache.bdstatic.com/static/v1/mip.js"> </script>
The head label must contain <link rel = "canonical" href = "http (s): // xxx">
Page element usage specification
Mip html prohibits the use of tags that have a great impact on page performance and security. Replace the tags with the unique tags of MIP (for example, replace img tags with mip-img ):
Tag |
Scope of use |
Remarks |
Img |
Replace with mip-img |
|
Video |
Replace with mip-video |
|
Audio |
Replace with mip-audio |
|
Iframe |
Replace with mip-iframe |
|
Style |
Replace with <style mip-custom> |
It can be used only once in the head label. |
Script |
Disable |
Script tags are not allowed, except in the following two cases: 1) js required for the external link mip component, 2) type is "application/ld + json" or "application/json" |
Svg |
Allowed |
|
Button |
Allowed |
|
Link |
Allowed |
|
A |
Allowed. We recommend that you use the mip-link component instead. |
Href = "javascript:" is not allowed. The target must be set to _ blank. |
Frame |
Disable |
|
Frameset |
Disable |
|
Object |
Disable |
|
Param |
Disable |
|
Applet |
Disable |
|
Embed |
Disable |
|
Form |
Replace with mip-form |
The input and textarea labels can be used internally. |
Input elements |
Disable |
Including: select, option |
HTML attributes
- All attributes starting with on in mip html cannot be used, such as onclick and onmouseover.
- The on attribute is allowed in mip html.
- Style attribute is not allowed in mip html.
Custom style usage specification
For performance considerations, inline style is not allowed in html. All styles can only be placed in the style label of the head.
Correct:
<Head>
<Stylemip-custom>
P {color: # 00f ;}
</Style>
</Head>
<Body>
<P> Hello World! </P>
</Body>
Error:
<Pstyle = "color: # 00f;"> Hello World! </P>
Verification specification
MIP verification tool address: https://www.mipengine.org/validator/validate