实现以上图片中内容
代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>搜索框</title>
<style>
.search-container {
display: flex;
align-items: center;
background-color: #fcf8f8;
padding: 5px;
border-radius: 5px;
border: 1px solid #0f0f0f;
}
.search-input {
border: none;
color: #333;
font-size: 14px;
padding: 3px;
width: 150px;
}
.search-icon {
width: 16px;
height: 16px;
fill: #333;
margin-right: 8px;
}
.search-container:hover {
border-color: #666;
}
.search-container:focus-within {
border-color: #141414;
}
</style>
</head>
<body>
<div class="search-container">
<img width="15" height="15" src="F:\web-前端\a.png">
<input type="text" class="search-input" placeholder="音乐/视频/电台/用户">
</div>
</body>
</html>
运行结果如下: