MIP HTML specification


Header usage specifications

  • Start tag use<!doctype html>

  • html tag must be added with mip Tags, that is: <html mip>

  • must contain <head> and <body> tags

  • must be in the head tag Contains character set declaration: <meta charset="utf-8">, the character set is unified to utf-8

  • ##The viewport must be included in the head tag Set tag: <meta name="viewport" content="width=device-width,initial-scale=1">, it is recommended to include

    minimum-scale=1

  • Must include < link rel="stylesheet" type="text/css" href="

    https://mipcache.bdstatic.com/static/v1/mip.css## in the head tag #" >

  • Must include <script src="
  • https://mipcache.bdstatic.com/static/v1/mip.js## in the body tag #" ></script >

    Must include <link rel="canonical" href="http(s)://xxx" > in the head tag
  • Page element usage specifications
MIP HTML prohibits the use of tags that have a greater impact on page performance and security. Please replace them with MIP-specific tags (for example: Replace the

img

tag with

mip-img):

##HTML attribute

QQ截图20170204104936.png

MIP All attributes starting with
  • on

    in the MIP HTML are not allowed to be used, such as: onclick, onmouseover. The

    on
  • attribute is allowed in MIP HTML.
  • The style

    attribute is not allowed in MIP HTML.
  • Custom style usage specifications
  • Due to performance considerations, inline style is not allowed in html, and all styles can only be placed in the style tag of the head.
  • Correct:
<head>
    <style mip-custom>
        p { color: #00f;}
    </style>
</head>
<body>
    <p>Hello World!</p>
</body>
  • Error:
<p style="color:#00f;">Hello World!</p>

Verification specification

MIP verification tool address: https://www.mipengine.org/validator/validate