🌟 特点
- 🎨 优雅的渐变背景
- 💫 平滑的动画效果
- 🎯 简约的 Logo 设计
- 📱 完美的响应式支持
- 🔍 精致的搜索图标
- 💎 现代化的阴影效果
🛠️ 技术特点
-
简单集成
- 单文件设计,复制即可使用
- 无需引入任何外部库或框架
-
视觉设计
- 使用 CSS 渐变背景创造层次感
- 采用柔和的阴影效果
- Logo 搭配动画效果提升品质感
-
交互体验
- 搜索按钮悬浮缩放效果
- 输入框聚焦时阴影变化
- Logo 加载时的淡入动画
-
响应式设计
- 完美适配移动端
- 自适应各种屏幕尺寸
📦 使用方法
- 下载
index.html
文件 - 用浏览器直接打开即可使用
- 可以根据需要修改 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>
更多免费代码:代码魔方