1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > html里面怎么设置搜索框 html搜索框怎么做

html里面怎么设置搜索框 html搜索框怎么做

时间:2022-03-29 09:12:37

相关推荐

html里面怎么设置搜索框 html搜索框怎么做

html搜索框怎么做

使用HTML做搜索框的方法:

1、首先新建一个div,id名为box,用来包裹搜索框;

2、然后在内部添加一个input标签和一个div标签,一个用来输入文字,一个充当按钮;

3、最后使用css为它们设计样式即可。

Examples

#box{

width: 380px;

margin: 30px auto;

font-family: 'Microsoft YaHei';

font-size: 14px;

}

input{

width: 260px;

border: 1px solid #e2e2e2;

height: 30px;

float: left;

background-image: url(images/search.jpg);

background-repeat: no-repeat;

background-size: 25px;

background-position:5px center;

padding:0 0 0 40px;

}

#search{

width: 78px;

height: 32px;

float: right;

background: black;

color: white;

text-align: center;

line-height: 32px;

cursor: pointer;

}

搜索

效果:

更多相关教程,请关注PHP中文网!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。