web-前端小实验6

实现以上图片中的内容

代码

html 复制代码
<!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;
    border: 2px solid red;
    border-radius: 5px;
    padding: 5px;
    width: 1000px;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 5px;
    font-size: 16px;
}

.search-button {
    background-color: red;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 5px 10px;
    margin-left: 5px;
    cursor: pointer;
}

.camera-button {
    background-color: transparent;
    border: none;
    cursor: pointer;
    margin-left: auto;
    padding: 5px;
}

.camera-button img {
    width: 20px;
    height: 20px;
}
    </style>
</head>
<body>
    <div class="search-container">
        <input type="text" class="search-input" placeholder="小白熊恒温调奶器">
        <button class="camera-button">
            <img src="F:\web-前端\屏幕截图 2025-01-12 153808.png" alt="相机图标">
        </button>
        <button class="search-button">搜索</button>
    </div>
</body>
</html>

运行结果如图:

相关推荐
ai小鬼头6 分钟前
百度秒搭发布:无代码编程如何让普通人轻松打造AI应用?
前端·后端·github
漂流瓶jz6 分钟前
清除浮动/避开margin折叠:前端CSS中BFC的特点与限制
前端·css·面试
前端 贾公子9 分钟前
在移动端使用 Tailwind CSS (uniapp)
前端·uni-app
散步去海边9 分钟前
Cursor 进阶使用教程
前端·ai编程·cursor
清幽竹客10 分钟前
vue-30(理解 Nuxt.js 目录结构)
前端·javascript·vue.js
weiweiweb88811 分钟前
cesium加载Draco几何压缩数据
前端·javascript·vue.js
幼儿园技术家12 分钟前
微信小店与微信小程序简单集成指南
前端
我不吃饼干9 天前
鸽了六年的某大厂面试题:你会手写一个模板引擎吗?
前端·javascript·面试
涵信9 天前
第一节 布局与盒模型-Flex与Grid布局对比
前端·css
我不吃饼干9 天前
鸽了六年的某大厂面试题:手写 Vue 模板编译(解析篇)
前端·javascript·面试