|
发表于 2020-2-11 20:26:39
|
显示全部楼层
本楼为最佳答案
1、通过   可以对齐:
2、更好的做法通过 CSS 实现
修改代码:
- <form method="POST">
- <div class="block">
- <label for="username">用户名:</label>
- <input type="text" name="username">
- </div>
- <div class="block">
- <label for="password">密码:</label>
- <input type="password" name="password">
- </div>
- <div class="block center">
- <input id="logclick" type="submit" value="登录">
- <input id="logout" type="submit" value="退出">
- </div>
- </form>
复制代码
添加 CSS:
- label {
- display: inline-block;
- width: 100px;
- text-align: right;
- }
复制代码
底下按钮样式没有管~ |
|