html - 增加两个部分之间的距离
问题描述
section.profile{
background: var(--black);
display: flex;
align-items: center;
padding: 3rem;
margin-top: 60px;
}
section.profile .left{
flex: 2px;
display:flex;
align-items: center;
}
section.profile .right{
flex:1;
}
section.profile .left h2{
color: var(--fade);
font-size: 24px;
font-weight:600;
margin-bottom: 1rem;
}
这是代码,我附上了我所拥有的和我想要的图片:
谢谢 :)
这是代码使用(HTML):https ://www.codepile.net/pile/2o9J4WZw 这是使用代码(CSS):https ://www.codepile.net/pile/2o9J4WZw
解决方案
从左到右部分添加填充左或边距
.right{
padding-left:25px
}
或者
.right{
margin-left:25px
}
否则,您可以使用引导网格分为两列参考:https ://getbootstrap.com/docs/4.0/layout/grid/
推荐阅读
- batch-file - 有没有办法将windows服务的pid保存在var中?
- google-app-engine - Vue 生产 URL 重定向在 gae 上返回 404
- java - 这是 Netty 从封闭通道读取的示例吗?
- python - Pandas:转置按列 a 分组的列 (b,c,d) 作为索引
- r - 如何以长格式改变小标题的值
- kotlin - 我可以在没有运行的情况下在 Kotlin 中创建一个可变的函数集合吗?
- javascript - 如何使用“spec”和“mocha-multi-reporters”将失败的测试结果输出到控制台
- c - 单引号和撇号的区别?
- sql - 如何避免 SQL 中的歧义列错误?
- python - 如何使用 itertools 解决这个问题?