写一个html 页 有一个input和button
时间: 2024-02-05 07:04:54 浏览: 27
好的,以下是一个简单的HTML页面,包括一个输入框和一个按钮:
```html
<!DOCTYPE html>
<html>
<head>
<title>输入框和按钮</title>
</head>
<body>
<input type="text" placeholder="在这里输入" />
<button>提交</button>
</body>
</html>
```
在这个HTML页面中,`<input>`元素定义了一个文本输入框,`<button>`元素定义了一个按钮。输入框中的`placeholder`属性指定了在输入框为空时要显示的占位符文本。您可以通过将此HTML代码复制并将其粘贴到文本编辑器中并保存为`.html`文件来创建一个完整的HTML页面。
相关问题
用HTML写一个登录页面 有设计感
以下是一个简单的登录页面,带有设计感:
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f7f7f7;
}
form {
background-color: #fff;
border-radius: 10px;
max-width: 400px;
margin: 0 auto;
padding: 20px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}
h1 {
text-align: center;
color: #333;
margin-bottom: 30px;
}
label {
display: block;
color: #333;
margin-bottom: 10px;
}
input[type="text"],
input[type="password"] {
width: 100%;
padding: 10px;
border-radius: 5px;
border: 1px solid #ccc;
margin-bottom: 20px;
}
button[type="submit"] {
background-color: #007bff;
color: #fff;
padding: 10px;
border-radius: 5px;
border: none;
cursor: pointer;
}
button[type="submit"]:hover {
background-color: #0069d9;
}
</style>
</head>
<body>
<form>
<h1>Login</h1>
<label for="username">Username</label>
<input type="text" id="username" name="username" placeholder="Enter your username">
<label for="password">Password</label>
<input type="password" id="password" name="password" placeholder="Enter your password">
<button type="submit">Login</button>
</form>
</body>
</html>
```
这个登录页面使用了简单的样式和布局,以使其看起来更有设计感。它具有圆角,阴影和蓝色按钮。输入字段有适当的填充,边框和标签以及占位符文本。该页面在现代浏览器中应该看起来不错,但可能需要对旧浏览器进行兼容。
用layui和html写一个登录前端页面
好的,下面是一个简单的登录页面的代码,使用了layui框架和HTML:
```html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>登录页面</title>
<link rel="stylesheet" href="https://cdn.staticfile.org/layui/2.5.6/css/layui.min.css">
<script src="https://cdn.staticfile.org/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdn.staticfile.org/layui/2.5.6/layui.min.js"></script>
</head>
<body>
<div class="layui-container">
<div class="layui-row">
<div class="layui-col-md-offset3 layui-col-md6">
<form class="layui-form" action="">
<div class="layui-form-item">
<label class="layui-form-label">用户名</label>
<div class="layui-input-block">
<input type="text" name="username" required lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">密码</label>
<div class="layui-input-block">
<input type="password" name="password" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="login">登录</button>
</div>
</div>
</form>
</div>
</div>
</div>
</body>
</html>
```
这里使用了Layui的网格系统,将表单放在一个6列的区域中。表单中包括用户名和密码两个输入框,以及一个登录按钮。通过Layui的表单验证,可以保证用户必须填写用户名和密码才能进行登录操作。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)