无法让侧边栏扩展到父容器
如 this 小提琴所示,我无法获取 customer-sidebar
那个左侧为黄色,可扩展到右侧 div 的高度。我的 main-content
div 位于右侧,它有一些发货,这些发货可能会有所不同,因此我希望侧边栏扩展到相同的高度,否则它们的长度将不均匀。我尝试了“明确修复”解决方案,但它似乎对我不起作用。有人可以告诉我为什么它不起作用以及如何修复它吗?
As illustrated in this fiddle, i can't get the customer-sidebar
the one in yellow on the left to expand to the height of the div on the right. I have the main-content
div on the right and it has some shipments, these shipments could vary and hence i want the sidebar to expand to the same height otherwise they will be of uneven length. I tried the "clear fix" solution but it doesn't seem to be working for me. Can someone give me a pointer as to why it's not working and how to fix it ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该将它们一个放在另一个中,并将最长的一个放在最短的一个中。
如果客户侧边栏一定是最短的,请将主要内容侧边栏放在其中。
结构应该是:
You should place them one in another, and place the longest one in the shortest one.
If the customer-sidebar is bound to be the shortest, place the main-content sidebar inside it.
The structure should be :
一种方法是创建一个 1 像素高、1000 像素宽的图像[“页面包装”的宽度],横跨侧边栏和活动货件,并将图像设置为页面包装内的背景,这称为“人造”柱技术。
您可以截取页面的屏幕截图并使用截图工具来获取您需要的图像。
One way would be to create an image 1 pixel high and 1000px wide [the width of your "page wrapper"] spanning across both the side bar and the active shipment and set the image as a background within the page wrapper this is called the faux column technique.
You can take a screen shot of the page and use a snipping tool to get the image you need.