首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在响应性设计中使div出现在容器之外。

在响应性设计中使div出现在容器之外。
EN

Stack Overflow用户
提问于 2016-01-20 20:48:38
回答 1查看 689关注 0票数 0

我试图让一些浮动元素出现在使用基于Omega的主题的drupal页面的容器之外。我的页面目前的结构如下:

代码语言:javascript
复制
<h2>Some header text</h2>
<div class="grid-12 region region-content center" id="region-content">
  <div class="container-12">
    <div class="pricing-main-background">
      <div class="grid-4 plan-box-orange">
      </div>
      <div class="grid-4 plan-box-green">
      </div>
      <div class="grid-4 plan-box-orange">   
      </div>
    <div class="pricing-subtext">
      some more text down here            
    </div>
  </div>
 </div>
</div>

下面是我想要完成的任务的草图(注意容器外的较小的盒子):

视觉辅助

有人能帮助提供一种方法来使这个工作(更好地说,不需要混乱的CSS时,盒子堆叠(480 to )?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-01-20 21:20:06

像这样吗?

代码语言:javascript
复制
h2
{
    width:60%;
    border:1px solid black;
    border-bottom:0;
    margin:0 auto;
    text-align:center;
}
.grid-12
{
    width:60%;
    border:1px solid black;
    margin:0 auto;
    text-align:center;
}
.pricing-main-background {position:relative;}
.plan-box-orange {background:orange;}
.plan-box-green {background:green;}
.grid-4
{
    display:inline-block;
    width:30%;
    height:50px;
    margin-top:25px;
}
.grid-4:nth-of-type(1)
{
    position:absolute;
    left:-10%;
}
.grid-4:nth-of-type(3)
{
    position:absolute;
    right:-10%;
}
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34910221

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档