简体   繁体   English

您如何在Zurb Foundation中出血列背景?

[英]How do you bleed a column background in Zurb Foundation?

What is the Zurb Foundation 4 way of extending the background of a column to the edge of the screen, while maintaining responsiveness? Zurb Foundation 4在保持响应能力的同时将列的背景扩展到屏幕边缘的方式是什么?

As an example, see the blue column in the illustration below. 例如,请参见下图中的蓝色列。

在此处输入图片说明

Update: 更新:

I was able to achieve this by setting the column's child element to margin-left: -9999px; padding-left: 9999px; 我可以通过将列的子元素设置为margin-left: -9999px; padding-left: 9999px;来实现margin-left: -9999px; padding-left: 9999px; margin-left: -9999px; padding-left: 9999px; . But I still wonder if there's a more proper way of doing it. 但是我仍然想知道是否有更合适的方法来做到这一点。

Update: 更新:

I was able to come up with a better solution, involving pseudo elements, see below. 我能够提出一个更好的解决方案,其中涉及伪元素,请参见下文。 Thanks @Paulie_D for the tip! 感谢@Paulie_D的提示!

It looks like the best option is to use pseudo elements . 看起来最好的选择是使用伪元素 The following CSS code applies bleeding to the left-side column. 以下CSS代码将出血应用于左侧列。

.column { position: relative; }
.column:before { 
    content: ""; 
    position: absolute; 
    top: 0; 
    bottom: 0; 
    width: 100%; 
    right: 100%;
}

See Column Bleeding in action. 请参阅实际使用中的列出血 For more information, see this article (thanks @Paulie_D). 有关更多信息,请参见本文 (感谢@Paulie_D)。

I'd be happy to select a better solution, if anyone has any. 如果有人有,我很乐意选择一个更好的解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM