如何在HTML标题中添加或改变图片

只需要在head中添加如下代码:

<link rel="Shortcut Icon" href="你的ico图片地址" />

一般标题栏里的图片是16*16像素

代码如下

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="shortcut icon" type="image/x-icon" href="./1.jpg"/>
</head>

效果如图:

猜你喜欢

转载自blog.csdn.net/poluocook/article/details/123588743
今日推荐