html

html的搜索框代码怎么写

木子
3883
2021-05-12 18:05:10
栏目: 编程语言

html的搜索框代码:1、在dw中创建一个input框和button按钮。2、分别为input框和button按钮设置样式即可。


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>



0
看了该问题的人还看了