所有现代/有用的HTML5链接和元标记的快速参考

2020-12-23 07:22:49

对于每个HTML页面,您都应该具有一些关键元素来确保快速加载和良好的SEO。下面的模板为您提供了所有这些功能,您可以根据需要快速自定义这些功能。如果您要分别将它们拉出,我还将在下面列出所有有用的元标记。

<!DOCTYPE HTML>< html> < head> < title>我的网站< / title> < link rel =" icon" type =" text / png" href =" https://fjolt.com/favicon.png"> <!-如果您使用的是Google字体,请加载-> <!-< link rel =" preconnect" href =" https://fonts.gstatic.com">-> <元名称=“说明” content ="我的网站说明" <元名称="机器人"内容="索引,跟随" <元名称="关键字" content ="您的站点的标签< link rel ="规范" href ="此页面的网址"> < meta property =" og:title" content ="我的网站" /> < meta property =" og:description" content ="我的网站说明" /> < meta property =" og:image" content ="代表我的网站的图片URL" /> < meta属性=" og:url" content ="此页面的网址" /> < meta属性=" og:site_name" content ="我的网站" /> <元名称=&#34:twitter:card" content =" summary_large_image"> <元名称=&#34:twitter:site" content =" https://fjolt.com"> <元名称=" twitter:title" content =" {{title}}"> <元名称=&#34:twitter:描述" content =" {{description}}"> <元名称=&#34:twitter:image" content =" {{image}}"> <!-对于移动设备-> <元名称="视口" content ="初始比例= 1,最大比例= 1" <!-全局站点标记(gtag.js)-Google Analytics(分析)-> <!-如果您使用的是Google Analytics(分析),请使用脚本中的[[ID HERE]]和代码替换为ID-> <!-<脚本异步src =" https://www.googletagmanager.com/gtag/js?id = G- [[ID HERE]]">< / script> < script> var host = window.location.hostname; if(host!==" localhost"){window.dataLayer = window.dataLayer || [];函数gtag(){dataLayer.push(arguments);} gtag(' js&#39 ;,新的Date()); gtag(' config&#39 ;,' [[ID HERE]]'); }< / script>-> <!-预加载样式表-> < link rel ="预加载" href =" /style.css" as =" style" /> <!-如果要加载一些CSS异步注释,请----> <!-< link rel =" preload" href =" /async.css" as =" style" />-> <!-必要时预加载字体-> < link rel ="预加载" href =" /fonts/fontName.ttf" as =" font" crossorigin ="匿名" /> < link rel ="预加载" href =" /fonts/fontName.ttf" as =" font" crossorigin ="匿名" /> <!-加载样式表-> < link rel =" stylesheet" href =" /style.css" /> <!-如果要加载一些CSS异步注释,请----> <!-link rel =" stylesheet" href =" /async.css" media ="打印" onload =" this.media =' all'"- < / head> < body> <!-您的网站正文-> <!-您的主要JS脚本-> <脚本延迟src =" local.js">< / script> < / body>< / html>

<!-表示它将在iOS设备上以全屏模式运行-> <!-在iOS中设置顶部乐队的颜色,要求能够设置apple-mobile-web-app-- <!-在此页面上自动检测Apple设备上的电话号码-> <!-对于移动设备->