HTML中link标签属性详解 |
在HTML中,
一个典型的 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>My Website</title> <!-- 链接到外部CSS样式表 --> <link rel="stylesheet" href="styles.css" rel="external nofollow" rel="external nofollow" > <!-- 链接到网站图标 --> <link rel="icon" href="favicon.ico" rel="external nofollow" > </head> <body> <h1>Link!</h1> <p>这是一段link的介绍 。</p> </body> </html> 在这个示例中,我们使用了两个 当然,
<link rel="stylesheet" href="styles.css" rel="external nofollow" rel="external nofollow" type="text/css">
<link rel="stylesheet" href="print.css" rel="external nofollow" media="print">
<link rel="icon" href="icon-48x48.png" rel="external nofollow" sizes="48x48"> <link rel="icon" href="icon-96x96.png" rel="external nofollow" sizes="96x96">
<link rel="stylesheet" href="https://link.com/styles.css" rel="external nofollow" rel="external nofollow" crossorigin="anonymous">
<link rel="stylesheet" href="https://link.com/styles.css" rel="external nofollow" rel="external nofollow" crossorigin="anonymous" integrity="sha256-base64-encoded-hash">
<link rel="preload" href="font.woff2" rel="external nofollow" rel="external nofollow" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="font.woff2" rel="external nofollow" rel="external nofollow" as="font" type="font/woff2" crossorigin> 这些是 除了前面提到的,
<link rel="alternate" hreflang="es" href="https://link.com/es/a" rel="external nofollow" > <link rel="alternate" media="only screen and (max-width: 640px)" href="https://link.com/mobile/a" rel="external nofollow" >
<link rel="dns-prefetch" href="//link.com" rel="external nofollow" >
<link rel="preconnect" href="https://link.com" rel="external nofollow" >
<link rel="prefetch" href="pre-page.html" rel="external nofollow" >
<link rel="canonical" href="https://link.com/a/post" rel="external nofollow" >
<link rel="manifest" href="manifest.json" rel="external nofollow" > 请注意,不同的浏览器对于这些属性和功能的支持程度可能会有所不同 。建议在使用新功能时查阅相关文档,以确保兼容性和功能性 。 以上就是HTML中link标签属性详解的详细内容,更多关于HTML link标签的资料请关注其它相关文章! |