利用CSS写精美搜索框

article/2025/8/27 10:17:38

利用html写搜索样式框

在这里插入图片描述

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>8款纯CSS3搜索框</title><link href="http://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"><link rel="stylesheet" href="style.css"><style>* {box-sizing: border-box;}body {margin: 0;padding: 0;background: #494A5F;font-weight: 500;font-family: "Microsoft YaHei","宋体","Segoe UI", "Lucida Grande", Helvetica, Arial,sans-serif, FreeSans, Arimo;}#container {width: 500px;height: 820px;margin: 0 auto;}div.search {padding: 30px 0;}form {position: relative;width: 300px;margin: 0 auto;}input, button {border: none;outline: none;}input {width: 100%;height: 42px;padding-left: 13px;padding-right:46px;}button {height: 42px;width: 42px;cursor: pointer;position: absolute;}/*搜索框1*/.bar1 {background: #A3D0C3;}.bar1 input {border: 2px solid #7BA7AB;border-radius: 5px;background: #F9F0DA;color: #9E9C9C;}.bar1 button {top: 0;right: 0;background: #7BA7AB;border-radius: 0 5px 5px 0;}.bar1 button:before {content: "\f002";font-family: FontAwesome;font-size: 16px;color: #F9F0DA;}/*搜索框2*/.bar2 {background: #DABB52;}.bar2 input, .bar2 button {border-radius: 3px;}.bar2 input {background: #F9F0DA;}.bar2 button {height: 26px;width: 26px;top: 8px;right: 8px;background: #F15B42;}.bar2 button:before {content: "\f105";font-family: FontAwesome;color: #F9F0DA;font-size: 20px;font-weight: bold;}/*搜索框3*/.bar3 {background: #F9F0DA;}.bar3 form {background: #A3D0C3;}.bar3 input, .bar3 button {background: transparent;}.bar3 button {top: 0;right: 0;}.bar3 button:before {content: "\f002";font-family: FontAwesome;font-size: 16px;color: #F9F0DA;}/*搜索框4*/.bar4 {background: #F15B42;}.bar4 form {background: #F9F0DA;border-bottom: 2px solid #BE290E;}.bar4 input, .bar4 button {background: transparent;}.bar4 button {top: 0;right: 0;}.bar4 button:before {content: "\f178";font-family: FontAwesome;font-size: 20px;color: #be290e;}/*搜索框5*/.bar5 {background: #683B4D;}.bar5 input, .bar5 button {background: transparent;}.bar5 input {border: 2px solid #F9F0DA;}.bar5 button {top: 0;right: 0;}.bar5 button:before {content: "\f002";font-family: FontAwesome;font-size: 16px;color: #F9F0DA;}.bar5 input:focus {border-color: #311c24}/*搜索框6*/.bar6 {background: #F9F0DA;}.bar6 input {border: 2px solid #c5464a;border-radius: 5px;background: transparent;top: 0;right: 0;}.bar6 button {background: #c5464a;border-radius: 0 5px 5px 0;width: 60px;top: 0;right: 0;}.bar6 button:before {content: "搜索";font-size: 13px;color: #F9F0DA;}/*搜索框7*/.bar7 {background: #7BA7AB;}.bar7 form {height: 42px;}.bar7 input {width: 250px;border-radius: 42px;border: 2px solid #324B4E;background: #F9F0DA;transition: .3s linear;float: right;}.bar7 input:focus {width: 300px;}.bar7 button {background: none;top: -2px;right: 0;}.bar7 button:before{content: "\f002";font-family: FontAwesome;color: #324b4e;}/*搜索框8*/.bar8 {background: #B46381;}.bar8 form {height: 42px;}.bar8 input {width: 0;padding: 0 42px 0 15px;border-bottom: 2px solid transparent;background: transparent;transition: .3s linear;position: absolute;top: 0;right: 0;z-index: 2;}.bar8 input:focus {width: 300px;z-index: 1;border-bottom: 2px solid #F9F0DA;}.bar8 button {background: #683B4D;top: 0;right: 0;}.bar8 button:before {content: "\f002";font-family: FontAwesome;font-size: 16px;color: #F9F0DA;}</style>
</head>
<body>
<div id="container"><div class="search bar1"><form><input type="text" placeholder="请输入您要搜索的内容..."><button type="submit"></button></form></div><div class="search bar2"><form><input type="text" placeholder="请输入您要搜索的内容..."><button type="submit"></button></form></div><div class="search bar3"><form><input type="text" placeholder="请输入您要搜索的内容..."><button type="submit"></button></form></div><div class="search bar4"><form><input type="text" placeholder="请输入您要搜索的内容..."><button type="submit"></button></form></div><div class="search bar5"><form><input type="text" placeholder="请输入您要搜索的内容..."><button type="submit"></button></form></div><div class="search bar6"><form><input type="text" placeholder="请输入您要搜索的内容..."><button type="submit"></button></form></div><div class="search bar7"><form><input type="text" placeholder="请输入您要搜索的内容..."><button type="submit"></button></form></div><div class="search bar8"><form><input type="text" placeholder="请输入您要搜索的内容..."><button type="submit"></button></form></div>
</div>
</body>
</html>

http://chatgpt.dhexx.cn/article/GxMWhtyZ.shtml

相关文章

JavaScript实现智能搜索框

应用场景&#xff1a; 1. 搜索框在页面中占据的空间过小&#xff0c;希望无论浏览到什么位置&#xff0c;可以轻易地回到并聚焦搜索框。 2. 搜索框里面的文字大小过小&#xff0c;希望能够在上方开辟一块空间放大内容 解决思路&#xff1a; 1. 对整个页面添加键盘事件keyup…

html中搜索栏怎么写,html搜索框怎么做

很多:从记忆角度讲运用(谐音记忆法,联想法) 平常来说呢,可分为(死记硬背发,音标记忆法) 另外:自己创造 总结【谐音记忆法,死记硬背发,音标记忆法】 html/css如何写出如下搜索框效果&#xff0c;请给出代码 html制作一个搜索框&#xff0c;代码是什么&#xff1f; 打开Hbuilder编…

搜索导航HTML,CSS 带搜索导航栏的示例代码

本文为大家介绍如何使用 CSS 创建一个带搜索的导航栏。 以下实例均是响应式的。 可以先看下效果图: 创建一个搜索栏 主页 关于 联系我们 /* 在顶部导航栏中添加黑色背景颜色 */ .topnav {overflow: hidden; background-color: #e9e9e9; } /* 设置导航栏的链接样式 */ .topnav …

淘宝网搜索框源代码

搜索框代码&#xff1a; <script typetext/javascript> alimama_pidmm_11487878_0_0; alimama_typeg; alimama_tks{}; alimama_tks.style_i1; alimama_tks.lg_i1; alimama_tks.w_i350; alimama_tks.h_i69; alimama_tks.btn_i1; alimama_tks.txt_s; alimama_tks.hot_i1; a…

百度搜索框代码,实现回车点击,跳转到新页面,简单

参考网站&#xff1a;https://110.nanshiw.com/ 上图为实现效果 代码如下&#xff1a; <script> function butClick() {var val document.getElementById("search_key").value;if(val.length 0){alert(搜索为空&#xff0c;请输入内容);return false;}else…

智能搜索框html代码,js实现搜索框关键字智能匹配代码

只要使用搜索引擎的朋友应该都有这样的体会&#xff0c;就是当在搜索框输入关键字的时候&#xff0c;会出现自能匹配现象&#xff0c;这绝对是非常好的用户体验&#xff0c;下面就是一段类似的代码&#xff0c;当然这里只是掩饰&#xff0c;所以只能匹配的数据都是本地固定好的…

html5搜索框在最右侧,html5搜索框特效点击搜索框弹出分类搜索框代码

特效描述:html5搜索框特效 点击搜索框弹出 分类搜索框。点击搜索框弹出分类搜索框代码 代码结构 1. 引入CSS 2. 引入JS 3. HTML代码 Search People Sara Soueidan Rachel Smith Peter Finlan Patrick Cox

网页添加百度搜索框代码大全

★ 用法&#xff1a;在下面选择合适的样式&#xff0c;复制代码到网页中相应位置粘贴即可。 ★ 样式一&#xff08;20030&#xff09; 代码&#xff1a; <iframe id"baiduframe" marginwidth"0" marginheight"0" scrolling"no" fr…

【项目】实现网页搜索框功能

一、实现搜索框的部分代码 【注&#xff1a;涉及api接口和中后台数据交互】 1. 最终呈现形式&#xff1a; 2. 代码实现&#xff1a; HTML文件中&#xff1a; <!-- 搜索框部分 --><div class"search-bar" fxFlexAlign"center" style" ma…

FLOWABLE流程引擎分析

flowable流程引擎分析 历史: flowable工作流引擎是从jboss的jbpm->alfresco的activiti->flowable 逐步演化过来的, 核心开发人员是同一个团队. 都是因为与原公司的设计理念存在分歧,导致两次出走. flowable自16年fork之后,已经成为一个活跃的社区,逐步赢得的许多工作流引…

流程引擎课堂(一)| 关于开源流程引擎Activiti 的需要注意的几点

编者按&#xff1a;流程引擎在各个行业都有应用&#xff0c;其重要性不言而喻&#xff0c;充分了解流程引擎是一项重要课题。本文详细介绍了开源流程引擎Activiti 的优点与局限性&#xff0c;为流程引擎的选型提出了参考性建议。 基础概念 首先&#xff0c;我们来了解几个概念…

自主研发的流程引擎怎么样?好用吗?

编者按&#xff1a;随着数字化管理的发展&#xff0c;企业对于业务流程系统的要求越来越精细化&#xff0c;有些企业选择自主研发的流程引擎&#xff0c;自主研发的流程引擎怎么样&#xff1f;本文介绍了一款国产自主研发的流程引擎。 为什么要自主研发 企业的流程系统很重要&…

流程引擎设计思路

前言 在现代化的企业管理模式中&#xff0c;会通过日积月累的经验形成一套流程化的作业&#xff0c;来满足企业日常的经营活动&#xff0c;这不仅能够规范工作要求&#xff0c;还能提高人员工作效率。经常也会说道&#xff0c;流程化的工作模式是一个公司成熟的标记&#xff0c…

流程引擎activiti

1、Activiti简介 2、入门程序 3、使用详解 4、springboot2.0整合工作流activiti6.0以及与业务集成时的一些坑 5、删除异常的流程 6、系列文章 7、提交、审批、撤销 8、Activiti会签 系列文档 画图时将一个跳转条件${hr2}写成了${hr2}现在不能办理了&#xff01; 如何删…

如何设计一个流程引擎

编者按&#xff1a;流程引擎是低代码平台的核心&#xff0c;它可以帮助我们去实现非常灵活的流程设计&#xff0c;极大的助力实现数据流转的的规范化。流程引擎是什么&#xff1f;国内外流程引擎有什么区别&#xff1f;如何设计一个流程引擎&#xff1f; 流程引擎 什么是流程引…

规则/流程引擎-ice简介

ice简介 视频地址&#xff1a; https://www.bilibili.com/video/BV1hg411A7jx/ ice简介视频 致力于解决灵活繁复的硬编码问题 官方文档&#xff1a;http://waitmoon.com/zh 背景介绍 规则/流程引擎想必大家并不陌生&#xff0c;耳熟能详的就有Drools&#xff0c;Esper&#x…

流程引擎基础知识

流程引擎基础知识 流程部署流程取消部署流程发起流程取回流程作废流程委托流程流转常用流程表介绍备注 流程部署 1.后台直接导入bpmn /**流程部署源代码*/public void deploy() {ProcessEngine processEngine ProcessEngines.getDefaultProcessEngine();RepositoryService re…

规则引擎和流程引擎我该怎么理解

流程引擎 什么是流程引擎 流程引擎就是“业务过程的部分或整体在计算机应用环境下的自动化”&#xff0c;它主要解决的是“使在多个参与者之间按照某种预定义的规则传递文档、信息或任务的过程自动进行&#xff0c;从而实现某个预期的业务目标&#xff0c;或者促使此目标的实…

流程引擎:流程定义、流程实例、任务

流程引擎&#xff1a;流程定义、流程实例、任务 流程定义(ProcessDefinition) 基于bpmn2图形流程 流程实例(ProcessInstance) 一个流程定义可以启动多个流程实例,流程实例之间互不影响 流程实例任务(Tasks) 一个流程实例对应多个流程任务(人工与自动)

流程引擎(flowable)之流程相关

代码示例&#xff1a;流程部署/发布 InputStream inputStream new DefaultResourceLoader().getResource("classpath:BusinessProcessBeanTest.test.bpmn20.xml").getInputStream();Deployment deploy configuration.getRepositoryService().createDeployment()//…