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>

运行结果如图:

相关推荐
htzyl20617 小时前
前端样式-弹窗淡入淡出,为什么你的 `transition` 一直不生效
前端·css·html
Brookty17 小时前
CSS基础知识(二):盒模型、内外边距、外边距折叠与父子元素的布局关系
前端·css
十有八七17 小时前
手搓 Agent(四):长点记性——上下文满了怎么办,怎么记住上一次
前端·人工智能·后端
叫个啥呢18 小时前
第一次写 DSH 插件:跟着自己的喜好实现个简单的代码管理插件
前端
掘金酱18 小时前
AI 带来的新生意|稀土掘金 X-Lab 年度大会招募开启
前端·后端·vibecoding
某哈压力大18 小时前
移动端 rem 适配
前端·vue.js·面试
泯泷19 小时前
Vercel AI SDK 6 完整教程系列 - 第一部分:基础入门篇
前端·javascript
lcy_2419 小时前
10 万条数据滚动不卡?聊聊我写的虚拟列表组件 vue-virtualize
前端
zhanlang021719 小时前
HTML 零基础入门到企业实战【第七章 7.5】表单验证基础属性:required、maxlength、placeholder
前端·html