欢迎光临散文网 会员登陆 & 注册

【html】做一个简单搜索框

2023-06-03 22:32 作者:吾乃意  | 我要投稿


例如

We always use the search box in the internet.

The picture above is an example.


So, what should we do to make such box load on the web page?

Let's realize the process.


Such search box use the form(表单提交) fuction.

The Html is form.

We write some codes:

<form action="" method="">

<input type="text">

<input type="submit">

</form>

 When we enter the code above, the Web will show us a input box and a button.

如图

How to enbellish the box to achieve its function?

We should confer the action of form, which is the adress we want to submit.

Then we also need method, like "get" or "post".

Otherwise, the input element also needs the attributes. Such name, we want to send the value to the adress.

At last,  we can use css to create the box appearance which is to add the class.


A case:

例子


可以增加一些修饰的css

例如
例如


各种搜索都可以查看一下,随便搜索一下看一下提交的搜索信息赋予的参数名。

例如


【html】做一个简单搜索框的评论 (共 条)

分享到微博请遵守国家法律