You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
<html lang="en">
<head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style> #form div { display: flex; /* height: 50px; */ /* stretch 是 align-items 默认值。元素被拉伸以适应容器。*/ /* align-items: stretch; */ /* flex-start:元素位于容器的开头。弹性盒子元素的侧轴(纵轴)起始位置的边界紧靠住该行的侧轴起始边界。 */ align-items: flex-start; flex: 0 0 30px; }
#form div label { flex: 0 0 100px; text-align: right; }
#form { display: flex; flex-direction: column; } </style> </head>
<body> <form> <div id="form"> <div> <label>姓名:</label> <input type="text"> </div> <div> <label>请输入密码:</label> <input type="text"> </div> </div> </form> </body>
</html>
|