请各位帮我看一下哪里出错了!谢谢!
本来想在搜索框中加入背景图片的,但是无论我怎么设置都还是不能显示出背景图
我尝试过设置背景颜色是可以的但是图片缺不行
<!DOCTYPE html>
<!-- 简体中文 --><html lang="zh-cmn-Hans">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="css\font-awesome.min.css" rel="stylesheet">
<link href="css\bootstrap.min.css" rel="stylesheet">
<title>商城主页面</title>
<style>
.logo{
width: 1000px;
height: 150px;
margin: 0,auto;
}
.bg{
background: url("img\cheakimg.jpg") no-repeat center;
background-size: cover;
width: 600px;
height: 150px;
align-items: center;
margin-left: 0px;
}
</style>
</head>
<body>
<div class="logo">
<img src="img\logo.png" width="300px" height="150px" style="margin-left: 60px; margin-right: 0px;">
<div class="bg" style="float: right;display: block; ">
<form style="margin-top: 60px; ">
<input type="text" value="捏麻麻滴好狗粮">
<input type="button" value="Search">
</form>
</div>
</body>
</html>
试着把这个类添加上去
```javascript
.bg1{
background: url("001.png") no-repeat center;
background-size: cover;
width: 300px;
height: 80px;
align-items: center;
margin-left: 0px;
}
```
只能说明 图片地址 不对 。文件结构截个图 。网络图片 可以
<!DOCTYPE html>
<!-- 简体中文 --><html lang="zh-cmn-Hans">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="css\font-awesome.min.css" rel="stylesheet">
<link href="css\bootstrap.min.css" rel="stylesheet">
<title>商城主页面</title>
<style>
.logo{
width: 1000px;
height: 150px;
margin: 0,auto;
}
.bg{
background: url("https://file06.16sucai.com/2018/0807/8c5e5ec44d75b76f09f1cba404e8e056.jpg") no-repeat center;
background-size: cover;
width: 600px;
height: 150px;
align-items: center;
margin-left: 0px;
}
</style>
</head>
<body>
<div class="logo">
<img src="img\logo.png" width="300px" height="150px" style="margin-left: 60px; margin-right: 0px;">
<div class="bg" style="float: right;display: block; ">
<form style="margin-top: 60px; ">
<input type="text" value="捏麻麻滴好狗粮">
<input type="button" value="Search">
</form>
</div>
</body>
</html>