登录界面一:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Business Login</title> <style> body { font-family: 'Arial', sans-serif; background-color: #f4f4f4; margin: 0; display: flex; align-items: center; justify-content: center; height: 100vh; } .login-container { background-color: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); width: 300px; /* 固定宽度 */ text-align: center; max-height: calc(300px * 1.618); /* 使用黄金比例计算最大高度 */ overflow: hidden; /* 隐藏溢出的部分 */ } .login-container h2 { color: #333; } .login-form { margin-top: 20px; } .form-group { margin-bottom: 15px; } label { display: block; margin-bottom: 8px; color: #555; } input { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; } button { background-color: #4caf50; color: #fff; padding: 10px 15px; border: none; border-radius: 4px; cursor: pointer; } button:hover { background-color: #45a049; } </style> </head> <body> <div class="login-container"> <h2> Welcome To My Page</h2> <form class="login-form"> <div class="form-group"> <label for="username">Username:</label> <input type="text" id="username" name="username" required> </div> <div class="form-group"> <label for="password">Password:</label> <input type="password" id="password" name="password" required> </div> <button type="submit">Login</button> </form> </div> </body> </html>
效果
登录界面二:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Business Login</title> <style> body { margin: 0; font-family: 'Arial', sans-serif; background: url('https://huamaobizhi.com/appApi/wallpaper/getImages_1_0/?pid=21526&resolution=1000w680h') no-repeat center center fixed; /* 示例图片链接,请替换为你的图片路径 */ background-size: cover; height: 100vh; display: flex; align-items: center; justify-content: center; /* 将登录框放置在页面中央 */ } .login-container { background-color: rgba(255, 255, 255, 0.5); /* 使用半透明的白色背景 */ padding: 20px; border-radius: 8px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.3); width: 300px; text-align: center; margin-left: 50%; } .login-container h2 { color: #333; } .login-form { margin-top: 20px; } .form-group { margin-bottom: 15px; } label { display: block; margin-bottom: 8px; color: #555; } input { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; } button { background-color: #4caf50; color: #fff; padding: 10px 15px; border: none; border-radius: 4px; cursor: pointer; } button:hover { background-color: #45a049; } </style> </head> <body> <div class="login-container"> <h2>Welcome To My Page</h2> <form class="login-form"> <div class="form-group"> <label for="username">Username:</label> <input type="text" id="username" name="username" required> </div> <div class="form-group"> <label for="password">Password:</label> <input type="password" id="password" name="password" required> </div> <button type="submit">Login</button> </form> </div> </body> </html>
效果
登录界面三:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Business Login</title> <style> body { margin: 0; font-family: 'Arial', sans-serif; background: url('https://huamaobizhi.com/appApi/wallpaper/getImages_1_0/?pid=21526&resolution=1000w680h') no-repeat center center fixed; background-size: cover; height: 100vh; display: flex; align-items: center; justify-content: center; } .login-container { background-color: rgba(255, 255, 255, 0.9); padding: 30px; border-radius: 10px; box-shadow: 0 0 20px rgba(0, 0, 0, 0.5); width: 400px; text-align: center; } .login-container h2 { color: #333; margin-bottom: 20px; } .login-form { display: flex; flex-direction: column; align-items: center; } .form-group { margin-bottom: 20px; width: 100%; } label { display: block; margin-bottom: 8px; color: #555; text-align: left; } input { width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; } button { background-color: #4caf50; color: #fff; padding: 12px; border: none; border-radius: 4px; cursor: pointer; width: 100%; font-size: 16px; } button:hover { background-color: #45a049; } </style> </head> <body> <div class="login-container"> <h2>Welcome To My Page</h2> <form class="login-form"> <div class="form-group"> <label for="username">Username:</label> <input type="text" id="username" name="username" required> </div> <div class="form-group"> <label for="password">Password:</label> <input type="password" id="password" name="password" required> </div> <button type="submit">Login</button> </form> </div> </body> </html>
效果
以上就是短视频app开发,可以借鉴的几个登录界面设计, 更多内容欢迎关注之后的文章
标签:界面设计,center,登录,color,margin,app,radius,background,border From: https://www.cnblogs.com/yunbaomengnan/p/18147223