只需要在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>
效果如图: