<input type="submit" value="登录"/>在这个基础上拓宽输入框
时间: 2023-07-19 12:35:40 浏览: 51
可以通过CSS设置input元素的宽度来拓宽输入框。例如,将input元素的宽度设置为80%:
```
<html>
<head>
<title>Title</title>
<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
form {
text-align: center;
}
input[type="text"], input[type="password"] {
width: 80%;
}
</style>
</head>
<body>
<form action="/login">
<input type="text" name="user"/>
<br/>
<input type="password" name="password"/>
<br/>
<input type="submit" value="登录"/>
</form>
</body>
</html>
```
其中,input[type="text"]和input[type="password"]选择器可以选择所有type属性为"text"和"password"的input元素。将宽度设置为80%可以使输入框拓宽。需要注意,由于输入框的宽度增加,需要添加换行符(<br/>)来使元素垂直排列,否则它们会挤在一起。