一个简洁优雅的搜索界面纯 HTML 和 CSS 开发

🌟 特点

  • 🎨 优雅的渐变背景
  • 💫 平滑的动画效果
  • 🎯 简约的 Logo 设计
  • 📱 完美的响应式支持
  • 🔍 精致的搜索图标
  • 💎 现代化的阴影效果

🛠️ 技术特点

  1. 简单集成

    • 单文件设计,复制即可使用
    • 无需引入任何外部库或框架
  2. 视觉设计

    • 使用 CSS 渐变背景创造层次感
    • 采用柔和的阴影效果
    • Logo 搭配动画效果提升品质感
  3. 交互体验

    • 搜索按钮悬浮缩放效果
    • 输入框聚焦时阴影变化
    • Logo 加载时的淡入动画
  4. 响应式设计

    • 完美适配移动端
    • 自适应各种屏幕尺寸

📦 使用方法

  1. 下载 index.html 文件
  2. 用浏览器直接打开即可使用
  3. 可以根据需要修改 Logo 文字或替换为图片

🎨 自定义修改

  • 修改颜色:调整 CSS 中的颜色值
  • 更换 Logo:替换 .logo 部分的内容
  • 调整尺寸:修改相应的 CSS 属性

希望这个简洁的搜索界面能够帮助到你的项目!如果觉得好用,欢迎分享和改进。

在这里插入图片描述

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>优雅搜索界面</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
        }

        .search-container {
            width: 90%;
            max-width: 600px;
            padding: 20px;
        }

        .search-form {
            position: relative;
            display: flex;
            align-items: center;
        }

        .search-input {
            width: 100%;
            padding: 15px 20px;
            font-size: 16px;
            border: none;
            border-radius: 50px;
            background: white;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
            transition: all 0.3s ease;
        }

        .search-input:focus {
            outline: none;
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
        }

        .search-button {
            position: absolute;
            right: 5px;
            padding: 10px;
            background: none;
            border: none;
            cursor: pointer;
            transition: transform 0.3s ease;
        }

        .search-button svg {
            fill: #666;
            transition: fill 0.3s ease;
        }

        .search-button:hover {
            transform: scale(1.1);
        }

        .search-button:hover svg {
            fill: #333;
        }

        @media (max-width: 480px) {
            .search-container {
                padding: 10px;
            }
            
            .search-input {
                padding: 12px 16px;
                font-size: 14px;
            }
        }

        .logo-container {
            text-align: center;
            margin-bottom: 30px;
        }

        .logo {
            font-size: 48px;
            font-weight: bold;
            color: #2c3e50;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
            letter-spacing: 2px;
            animation: fadeIn 1s ease-in;
        }

        .logo span {
            color: #3498db;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(-20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
    </style>
</head>
<body>
    <div class="search-container">
        <div class="logo-container">
            <div class="logo">Search<span>Pro</span></div>
        </div>
        <form class="search-form">
            <input type="text" class="search-input" placeholder="输入搜索内容...">
            <button type="submit" class="search-button">
                <svg viewBox="0 0 24 24" width="24" height="24">
                    <path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/>
                </svg>
            </button>
        </form>
    </div>
</body>
</html> 

更多免费代码:代码魔方

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值