【问题标题】:How get the div of one to spill on the other如何让一个人的 div 溢出到另一个人身上
【发布时间】:2013-11-18 13:15:52
【问题描述】:

我想创建一个 wordpress 网站,偶然发现了这个页面设计(不是 wordpress 的)https://www.refersion.com/pricing

如何为 in_content 创建自定义 CSS 以溢出到 .texture2。如页面所示,定价表溢出到页面标题。

请提前

【问题讨论】:

  • 其实这个页面是一个“错觉”。两个 div 没有溢出。主要包含的 div 有蓝色背景,只下降到现在,然后里面是标题 div(只是文本),下面(但仍然在蓝色背景上)是内容 div。

标签: css wordpress html layer


【解决方案1】:

在纹理 2 div 中,添加以下 CSS 属性:

position:relative and overflow:visible 

现在到 in_content div,添加以下 CSS 规则:

margin-top: -30px; //you can adjust the px value to suit your preference
position: absolute;

现在应该溢出了。

【讨论】:

  • 另外,请更改您问题的措辞,使其遵循良好的命名习惯。也许你可以称之为“让一个 div 溢出到另一个”
【解决方案2】:

在顶部 div 上使用负边距底部。快速示例:

<div style='width: 200px; height: 100px; margin-bottom: -50px; background-color: red;'>
Lala
</div>
<div style='width: 100px; height: 100px; background-color: green;'>
Lala
</div>

http://jsfiddle.net/yM2u5/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-09
    • 1970-01-01
    • 2014-02-23
    • 1970-01-01
    • 2017-11-25
    相关资源
    最近更新 更多