如何使用HTML制作一条垂直线?
当前回答
没有与<hr>元素等值的垂直元素。然而,你可能想尝试的一种方法是在你要分离的东西的左边或右边使用一个简单的边界:
# your_col { Border-left: 1px纯黑色; } < div id = " your_col " > 你的内容在这里 < / div >
其他回答
我需要一条内联的垂直线,所以我把一个按钮变成了一条直线。
<button type="button" class="v_line">l</button>
.v_line {
width: 0px;
padding: .5em .5px;
background-color: black;
margin: 0px; 4px;
}
要使垂直线在中间居中使用:
position: absolute;
left: 50%;
没有与<hr>元素等值的垂直元素。然而,你可能想尝试的一种方法是在你要分离的东西的左边或右边使用一个简单的边界:
# your_col { Border-left: 1px纯黑色; } < div id = " your_col " > 你的内容在这里 < / div >
要添加一条垂直线,你需要样式一个hr。
现在,当你画一条垂直线时,它会出现在页面的中间:
<hr style="width:0.5px;height:500px;"/>
现在把它放在你想要的地方,你可以使用下面的代码:
<hr style="width:0.5px;height:500px;margin-left:-500px;margin-right:500px;"/>
这将把它定位到左边,你可以把它反向定位到右边。
垂直到div
<div style="width:50%"> <div style="border-right:1px solid;"> <ul> <li> Empty div didn't shows line </li> <li> Vertical line length depends on the content in the div </li> <li> Here I am using inline style. You can replace it by external style or internal style. </li> </ul> </div> </div>
到div左边的垂直线
<div style="width:50%"> <div style="border-left:1px solid;"> <ul> <li> Empty div didn't shows line </li> <li> Vertical line length depends on the content in the div </li> <li> Here I am using inline style. You can replace it by external style or internal style. </li> </ul> </div> </div>
推荐文章
- 在CSS中@apply是什么?
- 在网页上用鼠标模拟震颤(例如帕金森病)?
- Bootstrap抛出Uncaught错误:Bootstrap的JavaScript需要jQuery
- 如何改变文本区域的边框颜色:焦点
- 我如何设置背景颜色为文本的宽度,而不是整个元素的宽度,使用CSS?
- 如何删除和清除所有的本地存储数据
- 设备像素比到底是什么?
- 我如何做一个半透明的背景?
- 强制打开“另存为…”弹出打开文本链接点击PDF在HTML
- 如何修改标签文本?
- 在CSS网格布局中等高行
- $(window).width()与媒体查询不一样
- 在HTML中还有其他有用的空格码吗,比如半空格的 , em-spaces, en-spaces等等?
- 输入触发器按钮单击
- 如何以及在哪里使用::ng-deep?