【发布时间】:2018-05-16 16:00:10
【问题描述】:
我有两个问题。
首先,
我有一个表单,我正在尝试将所有内容置于其中心,同时将文本与字段的左侧对齐。
我尝试将 justify-center 和 align-items 赋予“container”类和“form-style”类,但没有任何效果。
部分代码和Codepen链接
.form-style {
width: 50%;
position: relative;
display: flex;
flex-flow: column wrap;
justify-content: center;
align-items: center;
还有,
.container {
display: flex;
flex-flow: column wrap;
justify-content: center;
align-items: center;
}
第二,
我正在尝试让我的提交按钮获得 100% 的宽度并且什么都没有 - 两侧有空间,
input[type="submit"] {
display: block;
background-color: #08ABD9;
font-family: 'jura', sans-serif;
font-size: 16pt;
font-weight: bold;
height: 40px;
border: none;
margin-top: 40px;
margin-bottom: 0px;
width: 100%;
}
【问题讨论】:
-
您是否尝试将表单标签对齐到表单输入的左侧和顶部?
-
如果你看看我的 codepen,现在它是最接近的(只需要去掉右侧的多余空间)。但必须有更好的方法来做到这一点......
-
是的,标签、图例等'