Html 我如何使用CSS创建一条垂直分界线,该分界线位于两列的分界线的中心?

Html 我如何使用CSS创建一条垂直分界线,该分界线位于两列的分界线的中心?,html,css,Html,Css,布局为两列,均为47.5%,左列留有5%的边距。我想在中间有一条垂直的分界线。我目前使用的是右边框,但边框位于边距的左边缘,所以它是偏移的,而不是居中的 我正在使用Wordpress Divi主题,但以下HTML/CSS是我问题的症结所在: <style> .col-left {float:left;width:47.5%;margin-right:5%;border-right:3px solid #fff;height500px} .col-right {float:left;w

布局为两列,均为47.5%,左列留有5%的边距。我想在中间有一条垂直的分界线。我目前使用的是右边框,但边框位于边距的左边缘,所以它是偏移的,而不是居中的

我正在使用Wordpress Divi主题,但以下HTML/CSS是我问题的症结所在:

<style>
.col-left {float:left;width:47.5%;margin-right:5%;border-right:3px solid #fff;height500px}
.col-right {float:left;width:47.5%;height500px}
</style>

<div class="col-left"></div>
<div class="col-right"></div>

.col left{float:left;width:47.5%;margin right:5%;border right:3px solid#fff;height500px}
.col right{float:左;宽度:47.5%;高度500px}

Ben

更改CSS
右边距:2.5%;右侧填充:2.5%

.col-left {float:left;width:47.5%;margin-right:2.5%;padding-right:2.5%;border-right:3px solid #fff;height500px}