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>

运行结果如图:

相关推荐
anOnion2 小时前
构建无障碍组件之Menu Button pattern
前端·html·交互设计
用户47949283569152 小时前
claude Fable用不了?把Gpt 5.5pro接到你的claude code里
前端·后端
zhangxingchao5 小时前
Kotlin常用的Flow 操作符整理
前端
IT_陈寒6 小时前
React的useState居然还有这种坑?我差点删库跑路
前端·人工智能·后端
Pedantic8 小时前
SwiftUI 手势笔记
前端·后端
橙子家8 小时前
浏览器缓存之【结构化数据库与缓存】: IndexedDB、Cache storage 和 Storage buckets
前端
user20585561518138 小时前
X6 中边悬浮置顶,规避 `mouseleave` 事件丢失问题
前端
李明卫杭州8 小时前
CSS aspect-ratio 属性完全指南
前端
Pedantic10 小时前
SwiftUI 手势层级(Gesture Hierarchy)详解
前端