html css怎么制作这样一个搜索框?

html css怎么制作这样一个搜索框?,第1张

div 加底色

input去除默认样式 设定高度 宽度 背景用放大镜图片,不循环,靠右再写距离, 设置字体的颜色.下划线. 行高

</div>

input居中就直接margin 0 auto

或者特殊点就用定位 div写position:relative input用position:absolute

首先把搜索宽切片下来再CSS样式里面用为背景

<body>

<form action="" method="get">

<div class="kuan"><input name="" type="text" /></div><!--搜索框-->

<div class="an"><input name="" type="button" /></div><!--搜索按钮-->

</form>

</body>

CSS样式根据实际自己调整

<style type="text/css">

.kuan input{ width:330pxheight:60pxbackground:background:url(../img/kuan_01.jpg) no-repeatborder:nonefloat:left}

.an input{ width:120pxheight:60px background:background:url(../img/an_02.jpg) no-repeatborder:none float:left}

</style>


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/6123845.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-03-15
下一篇 2023-03-15

发表评论

登录后才能评论

评论列表(0条)

保存