3 个嵌套 div - 固定宽度父级、左侧和右侧右宽度基于内容,空中心宽度等于差值?
这可能真的很棘手!
这是我想要实现的目标:
这是我的 在 jsfiddle 上测试代码
我尝试了各种方法,但没有任何运气。 问题是左右 div 宽度均基于其中的文本宽度。我也不能让连接虚线位于左和右 div 下方,而只是用背景颜色掩盖它,因为网站的背景是渐变的。
至少在这种情况下,父 div 是固定的。
有什么想法吗?
This might be really tricky!
Here is what i want to achieve:
Here is my test code on jsfiddle
I've tried various things without any luck.
The problem is that both the left and right div widths are based on the text width within. I also cant have the joining dotted line going beneath the lef and right divs and just mask it by background colour as the background of the site is a gradient.
At least in this case, the parent div is fixed though.
Any thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我真的很讨厌提供有关使用表格的建议,但是,这将是使用 table/div/css 混合解决方案实现这一点的最简单方法。经过测试并有效。
I really hate offering suggestions on using tables but, This would be the easiest way to do it with a table/div/css hybrid solution. Tested and works.
在玩了一下 jsfiddle 代码并查找 3 列 CSS 灵活布局后,我尝试在谷歌上搜索“css 目录”。第一个条目是 CSS 目录,看起来可能适合您。否则,请查看帖子中引用的帖子或其他搜索结果。
After playing around with the jsfiddle code a little, and looking up 3-column CSS flexible layouts, I tried googling for 'css table of contents'. The first entry was CSS Table of Contents, which looks like it might work for you. Otherwise, look at the post being referred to in the post, or at other search results.