这篇“html的搜索框代码如何写”文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读完这篇文章能有所收获,下面我们一起来看看这篇“html的搜索框代码如何写”文章吧。
1、在dw中创建一个input框和button按钮,将它们摆放在同一排,代码如下:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>demo</title> </head> <body> <input type="" name="" id="" value="" /><button>搜索</button> </body> </html>
2、首先为input框添加“#7FCC0B”颜色的边框,并设置宽度和高度,再给button按钮设置白色的字体和“#7FCC0B”的背景颜色即可,代码如下:
<style type="text/css"> input{ width: 180px; height: 30pox; border:1px solid #7FCCOB; border-right: none; border-radius: 4px; } button { position: relative; right: 2px; width: 50px; height: 35px; font-size: 14px; color: white; backgrounf: #7FCC0B; border: 0; border-radius: 4px; </style> </head>