一个很好看的html 表单样式,样式居中。适合做登录

一个很好看的html 表单样式,样式居中。适合做登录

<!-- HTML 部分 -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Simple PHP Form</title>
<style>
    form {
        max-width: 300px;
        margin: 50px auto;
        padding: 20px;
        background: #f2f2f2;
        border: 1px solid #ddd;
        border-radius: 10px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    input[type="text"], input[type="email"] {
        width: 100%;
        padding: 10px;
        margin: 10px 0;
        border: 1px solid #ddd;
        border-radius: 5px;
    }
    input[type="submit"] {
        width: 100%;
        padding: 10px;
        background: #333;
        color: white;
        border: none;
        border-radius: 5px;
        cursor: pointer;
    }
    input[type="submit"]:hover {
        background: #555;
    }
</style>
</head>
<body>
 
<form action="submit.php" method="post">
    <input type="text" name="name" placeholder="Your Name" required>
    <input type="email" name="email" placeholder="Your Email" required>
    <input type="submit" value="Submit">
</form>
 
</body>
</html>

实际效果图

在这里插入图片描述