html登陆界面学历悬着
时间: 2023-10-19 10:08:49 浏览: 33
您好!对于HTML登录界面,可以使用以下代码作为基础实现:
```html
<!DOCTYPE html>
<html>
<head>
<title>登录页面</title>
<style>
body {
font-family: Arial, sans-serif;
padding: 20px;
}
label {
display: block;
margin-bottom: 10px;
}
input[type="text"],
input[type="password"] {
相关问题
html登陆界面居中
以下是一个HTML登陆界面居中的例子:
```html
<!DOCTYPE html>
<html>
<head>
<title>用户登陆</title>
<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
form {
display: flex;
flex-direction: column;
align-items: center;
padding: 20px;
border: 1px solid #ccc;
border-radius: 5px;
box-shadow: 0 0 5px #ccc;
}
input[type="text"], input[type="password"] {
width: 100%;
padding: 10px;
margin-bottom: 10px;
border: 1px solid #ccc;
border-radius: 5px;
box-sizing: border-box;
}
input[type="submit"] {
width: 100%;
padding: 10px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
</style>
</head>
<body>
<form>
<h2 style="text-align: center;">用户登陆</h2>
<label for="username">用户名:</label>
<input type="text" id="username" name="username" value="guest">
<label for="password">口令:</label>
<input type="password" id="password" name="password" value="guest">
<input type="submit" value="登陆">
</form>
</body>
</html>
```
HTML制作登陆界面
好的,制作登陆界面需要用到HTML、CSS和JavaScript。下面是一个简单的登陆界面的HTML代码:
```html
<!DOCTYPE html>
<html>
<head>
<title>Login Page</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="login-box">
<h2>Login Here</h2>
<form>
<p>Username</p>
<input type="text" name="username" placeholder="Enter Username">
<p>Password</p>
<input type="password" name="password" placeholder="Enter Password">
<input type="submit" name="submit" value="Login">
<a href="#">Forgot Password</a><br>
<a href="#">Don't have an account? Sign up</a>
</form>
</div>
</body>
</html>
```
其中,`<link>` 标签用于引入样式表,样式表的代码如下:
```css
body {
margin: 0;
padding: 0;
background: #f1f1f1;
}
.login-box {
width: 320px;
height: 420px;
background: #fff;
color: #000;
top: 50%;
left: 50%;
position: absolute;
transform: translate(-50%, -50%);
box-sizing: border-box;
padding: 70px 30px;
}
h2 {
margin: 0;
padding: 0 0 20px;
text-align: center;
font-size: 22px;
}
.login-box p {
margin: 0;
padding: 0;
font-weight: bold;
}
.login-box input {
width: 100%;
margin-bottom: 20px;
}
.login-box input[type="text"], input[type="password"] {
border: none;
border-bottom: 1px solid #000;
background: transparent;
outline: none;
height: 40px;
color: #000;
font-size: 16px;
}
.login-box input[type="submit"] {
border: none;
outline: none;
height: 40px;
background: #000;
color: #fff;
font-size: 18px;
border-radius: 20px;
}
.login-box input[type="submit"]:hover {
cursor: pointer;
background: #ffc107;
color: #000;
}
.login-box a {
text-decoration: none;
font-size: 14px;
color: #000;
}
.login-box a:hover {
color: #ffc107;
}
```
这个样式表定义了登陆界面的样式,包括背景颜色、登陆框的大小和位置、字体大小和颜色等。
相关推荐
![html](https://img-home.csdnimg.cn/images/20210720083451.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)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)