我试图让下面的“登录”按钮在我的登录表单的右端,但由于某种原因我无法实现它。
我想要的样子:
它目前的样子:
我的前端代码看起来像什么:
<RuxContainer className="container">
<div slot="header" className="header-container">
<h3 className="first-header-item">LOGO</h3>
<RuxClock timezone="Z"></RuxClock>
<RuxMonitoringIcon status="normal"></RuxMonitoringIcon>
</div>
<div className="body-container">
<form className="rux-form">
<h2 className="body-sign-in">SIGN IN</h2>
<h6>Measure your success in the Space Force!</h6>
<div className="sign-in-inputs">
<rux-input
id="email"
placeholder="[email protected]"
label="Email"
type="email"
ruxblur="{handleValidation()}"
></rux-input>
<rux-input id="pw" label="Password" type="password"></rux-input>
</div>
<div className="sign-in-helper-functions">
<rux-checkbox class="checkbox">Remember me</rux-checkbox>
<h2 className="forgot-password">Forgot Password?</h2>
</div>
</form>
<rux-button className="sign-in-btn" type="submit">
Sign in
</rux-button>
</div>
</RuxContainer>
CSS看起来像什么:
.header-container {
display: flex;
justify-content: space-between;
align-items: center;
}
.body-container {
display: flex;
flex-direction: column;
align-items: center;
}
.rux-form {
width: 30%;
max-width: 430px;
}
sign-in-btn {
align-self: flex-end;
}
我是新的CSS,所以任何帮助,将不胜感激,以及,谢谢!
2条答案
按热度按时间prdp8dxp1#
这不是真正的“前端代码”,因为它在浏览器中不起作用。如果你稍微整理一下,在
sign-in-btn
前面添加一个.
,它确实可以工作:bzzcjhmw2#