资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

搜索css样式,漂亮css搜索框样式

html 搜索框位置CSS样式问题

把搜索框放入一个div中,再给div加一个右浮动float:right;不就好了?位置不对再使用

创新互联建站专注为客户提供全方位的互联网综合服务,包含不限于网站设计制作、成都做网站、密云网络推广、成都小程序开发、密云网络营销、密云企业策划、密云品牌公关、搜索引擎seo、人物专访、企业宣传片、企业代运营等,从售前售中售后,我们都将竭诚为您服务,您的肯定,是我们最大的嘉奖;创新互联建站为所有大学生创业者提供密云建站搭建服务,24小时服务热线:18982081108,官方网址:www.cdcxhl.com

margin或者padding来调整

css页面中怎么快速的查找类样式

一个是在浏览器中使用开发者模式,一个是直接在文档中查询。

什么是CSS样式表?

CSS是Cascading Style Sheet 的缩写。译层叠样式表单、集联样式表等。

举个例子。比如table或div就是做房子的砖瓦,用他们把整个网站的框架搭好。而css就是房子的装饰。一个网站没有修饰是很难看的。

我们用CSS通常来修饰网站的色彩,文字等等。

要想了解更多关于CSS的,可以在网上搜搜,网上很多的。我只是用我的实践跟你讲。最后我只想说,样式和架框是分不开的。希望对你有帮助。

CSS搜索框样式

这个搜索框做的很好,看似简单,里面包含了大量CSS基础知识。由于时间关系,这里写了一个相似度为95%的样式供参考和学习,由于无法确认字体,先挑选了比较接近的Gautami

先上HTML

body

div id="A"

input id="inputTxt" type="text" placeholder="Search" /

div id="inputBtn"Go/div

/div

/body

这里开始写CSS

body { padding: 0; margin: 0; background: #D6D6D6; }

/*固定容器*/

#A { width: 316px; height: 28px; margin: 22% auto; border: 1px solid #A3A3A3; border-top-color: #939393; border-bottom-color: #D5D5D5; border-radius: 3px; box-shadow: 0px 1px 1px #f4f4f4; position: relative; }

#A  * { position: absolute; top: 0; }

/*输入框*/

#inputTxt { left: 0; width: 246px; height: 24px; background: #E6E6E6; border: 0; border-top: 1px solid #C8C8C8; border-bottom: 1px solid #E6E6E6; outline: none; padding-left: 30px; color: #666; }

#inputTxt::-webkit-input-placeholder,#inputTxt::-moz-placeholder { color: #B8B8B8; font: 600 13px 'Gautami'; }

/*按钮*/

#inputBtn { right: 0; width: 38px; height: 26px; line-height: 26px; background: linear-gradient(#E4E4E4, #B5B5B5); border: 1px solid transparent; border-top-color: #FCFCFC; border-left-color: #ADADAD; border-bottom-color: #B5B5B5; color: #6E6E6E; text-align: center; font-size: smaller; font-weight: bold; cursor: pointer; }

/*文字阴影*/

#inputTxt, #inputBtn, #inputTxt::-webkit-input-placeholder,#inputTxt::-moz-placeholder { text-shadow: 1px 1px 0px #fff; }

/*图标*/

#A:before, #A:after { content: ""; position: absolute; z-index: 2; box-shadow: 0px 1px 0px #fff; }

#A:before { left: 9px; top: 9px; width: 6px; height: 6px; border: 2px solid #ccc; border-radius: 50%; }

#A:after { left: 17px; top: 18px; width: 6px; height: 2px; background: #ccc; transform: rotate(45deg); -webkit-transform: rotate(45deg); -o-transform: rotate(45deg); }

最后,上效果图:上为原始搜索框,下为本次代码实现的搜索框

搜索框css样式

!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "

html xmlns="

head

meta http-equiv="Content-Type" content="text/html; charset=utf-8" /

title无标题文档/title

script type="text/javascript" src="jquery.js"/script

style

.{ padding:0; margin:0; list-style:none;}

.htmlBox{ width:100%; min-width:500px; height:500px; border:1px solid #A349A4; border-radius:5px;}

.sskBox{ width:100%; height:35px; margin-top:150px; border:1px solid #000; border-left:0; border-right:0;}

.zc{ width:100px; height:35px; float:left;}

.zj{ width:250px; height:35px; float:left; border-left:1px solid #000; border-right:1px solid #000;}

.yc{ height:35px; float:right;}

/style

/head

body

div class="htmlBox"

div class="sskBox"

div class="zc"左边100/div

div class="zj"中间250/div

div class="yc"右边自适应/div

/div

/div

/body

script

tmntH();//加载的时候执行一次

$(window).resize(function() {tmntH();});//浏览器窗口变化时执行

function tmntH()

{

var ycw=$(".sskBox").width()-352+'px';//yc的宽度等于sskBox宽度-350-2(边框线)

//alert(div3);

$(".yc").css("width",ycw);

}

/script

/body

/html


文章标题:搜索css样式,漂亮css搜索框样式
本文路径:http://cdkjz.cn/article/phisss.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220