react项目中public文件夹下index.html文件各标签的含义

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <!-- 设置网站标签栏上的偏爱图标,%PUBLIC_URL%指的是public路径 -->
    <link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
    <!-- 移动端适配视口 -->
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <!-- 在部分安卓手机浏览器的搜索栏的背景颜色主题,兼容性比较差,这段代码可要可不要 -->
    <meta name="theme-color" content="#000000" />
    <!-- SEO中TKD中的D,页面描述 -->
    <meta name="description" content="Web site created using create-react-app"/>
    <!-- 在苹果手机中,将页面链接创建到手机屏幕,显示的那个图标,只有苹果手机中有 -->
    <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
    <!-- 页面套壳,安卓壳,IOS壳的配置文件 -->
    <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
    <title>React App</title>
  </head>
  <body>
    <!-- 在不支持JS脚本的浏览器或者禁用JS脚本的浏览器,肯定运行不了JS,name就运行这个标签里面的内容 -->
    <noscript>You need to enable JavaScript to run this app.</noscript>
    <div id="root"></div>
  </body>
</html>
经验分享 程序员 微信小程序 职场和发展