我知道它不存在,但是有纯CSS版本吗?
想要设置高度,并将其设置为 1px 宽(如果可能的话,带有阴影)。
只是无法理解纯 CSS 的方式来做到这一点。需要绝对定位。
因为我的容器有两个并排的 div,例如 60-40% 的分割。需要两者之间的垂直规则,但不想使用border-left
在第 2 部分。
有什么建议么?
为此,您基本上需要设置一个放置它的位置,并且 div 语句可以工作。
<div style="width:150px;height:2px;background-color:#000000;"> </div>
这个也可以参考:
.hr {width:150px;height:2px;background-color:#000000;} // in your css file/script
<div class="hr"> </div> <!-- IN HTML -->
您可以通过 css 放置和 z-index 更改位置并使其向上/向下或向左/向右移动
.hr {width:2px;height:150px;background-color:#000000;position:absolute;top:0px;left:50px;z-index:10;} // in your css file/script
基本上
width = how wide you want it
height = how tall you want it
background-color = is the color you want it to be
position = absolute, relative, float - basically if it stays in one place or moves with page content
top = where to place in reference to top of page - could be margin-top
left = where to place in reference to left of page - could be margin-left
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)