html - 边距不当
问题描述
我正在完成一个新项目并遇到了这个问题。左侧的空间比右侧大。我尝试了很多解决方案,但都没有奏效。
这是我的主体和主体的 CSS 代码:
body {
font-family: $font;
font-size: 15px;
background: url(/images/bg-pattern-top-desktop.svg),
url(/images/bg-pattern-bottom-desktop.svg);
background-position: top left, top right;
background-repeat: no-repeat;
overflow-x: hidden;
margin: 0;
display: flex;
align-items: center;
justify-content: center;
padding-top: 70px;
}
main {
height: 70%;
}
还提供了整个代码的链接: https ://codepen.io/kyrylolvov-the-looper/pen/rNMYOwE
解决方案
添加align-items:flex-end;
,.second-row
这将正确显示:)
.second-row {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
align-items: flex-end; // Add this line of code
}
CODEPEN 工作链接: https ://codepen.io/emmeiWhite/pen/jOMabaQ
推荐阅读
- visual-studio - mfc OnVScroll 没有在 MDI 主框架类中被调用
- java - 如何在不留空白的情况下替换字符串?
- ios - 如何在快速向上和向下滚动表格时停止自动重新加载表格视图?
- ansible - 从 Jenkins 调用 Ansible 剧本
- java - 使用 Java 中的流对 BigInteger 列表求和
- postgresql - 如果删除了具有外键的行,如何在表中保留具有外键值的行?
- javascript - 在 Selenium 中显示 Javascript #document
- meteor - 如何使用 Meteor 中的 angular-meteor 根据在 FlowRouter 中输入的 rout 加载不同的视图
- bing - BING 拼写检查的例外列表
- r - 使用下载器通过 R 下载 PDF 时指定内容类型