本文介绍了如何在div的中心向下放置一条垂直线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在div的中间放置一条垂直线?也许我应该在div内放两个div,在一个上放一个左边框,在另一个上放一个右边框?我有一个DIV标签,我需要在左侧放一个ascx(它会不时与另一个ascx换出),然后在左侧放一个静态ascx.关于如何执行此操作的任何想法?也许我回答了我自己的问题.
How do I put a vertical line down the middle of a div? Maybe I should put two divs inside the div and put a left border on one and a right border on the other? I have a DIV tag and I need to put one ascx on the left (that will get swapped out from time to time with another ascx) and then a static ascx on the left. Any ideas on how I should do this? Maybe I answered my own question.
任何指针都很棒
推荐答案
也许这可以帮助您
.here:after {
content:"";
position: absolute;
z-index: -1;
top: 0;
bottom: 0;
left: 50%;
border-left: 2px dotted #ff0000;
transform: translate(-50%);
}
div {
margin: 10px auto;
width: 60%;
height: 100px;
border: 1px solid #333;
position:relative;
text-align:center
}
<div class="here">Content</div>
这是 JSFiddle 演示.
这篇关于如何在div的中心向下放置一条垂直线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!