首页 > 解决方案 > 增加两个部分之间的距离

问题描述

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 部分 第1部分 第2部分

这是代码使用(HTML):https ://www.codepile.net/pile/2o9J4WZw 这是使用代码(CSS):https ://www.codepile.net/pile/2o9J4WZw

标签: htmlcss

解决方案


从左到右部分添加填充左或边距

.right{
   padding-left:25px
}

或者

 .right{
  margin-left:25px
}

否则,您可以使用引导网格分为两列参考:https ://getbootstrap.com/docs/4.0/layout/grid/


推荐阅读