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>

运行结果如图:

相关推荐
夜郎king21 分钟前
HTML5 SVG 实现日出日落动画与实时天气可视化
前端·html5·svg 日出日落
夏幻灵1 小时前
HTML5里最常用的十大标签
前端·html·html5
Mr Xu_2 小时前
Vue 3 中 watch 的使用详解:监听响应式数据变化的利器
前端·javascript·vue.js
未来龙皇小蓝2 小时前
RBAC前端架构-01:项目初始化
前端·架构
程序员agions2 小时前
2026年,微前端终于“死“了
前端·状态模式
万岳科技系统开发2 小时前
食堂采购系统源码库存扣减算法与并发控制实现详解
java·前端·数据库·算法
程序员猫哥_2 小时前
HTML 生成网页工具推荐:从手写代码到 AI 自动生成网页的进化路径
前端·人工智能·html
龙飞052 小时前
Systemd -systemctl - journalctl 速查表:服务管理 + 日志排障
linux·运维·前端·chrome·systemctl·journalctl
我爱加班、、2 小时前
Websocket能携带token过去后端吗
前端·后端·websocket
AAA阿giao2 小时前
从零拆解一个 React + TypeScript 的 TodoList:模块化、数据流与工程实践
前端·react.js·ui·typescript·前端框架