将分隔线添加到CSS列
I am trying to create a row with 2 columns with a divider as shown below:
There is a light divider and also a white divider that should increase according to text amount like this:
How can I achieve this in CSS so that the white line divider increases based on the text amount in either column?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以为长效边框创建一个容器,并在文本元素上应用一个短裤
You can create a container for the long-stick border, and apply a short-stick border on text elements
其他各自的答案不能解决列
a
或b
可以具有变量内容的问题。并明确将保证金应用于任何一列都不会解决问题白色分隔线,该划分应根据此类文本数量增加
白线分隔线的增加,根据任一列中的文本量增加/代码>。解决方案
我想不出任何CSS解决方案,因为没有任何可用方法可以通过CSS获得元素的高度。必须使用一小部分JS解决问题。
尝试增加任何列中的内容,白色分隔线将相应增加。
希望这回答问题。
Other respective answers do not address the problem that either column
A
orB
can have variable content. And explicitly applying margin to any of the columns wouldn't solve the problemwhite divider that should increase according to text amount like this
andwhite line divider increases based on the text amount in either column
.Solution
I couldn't think of any CSS solution as there is not any available way to get elements height through CSS. Have to use a tiny bit of JS to solve the problem.
Try increasing content in any of the column, the white divider will increase accordingly.
Hope this answers the questions.