doujiao4705 2014-04-19 11:32
浏览 37
已采纳

我想修复一个响应式WordPress功能框

I want to create a feature box for Eleven40 Pro Wordpress theme. Here’s the PHP I used:

add_action( 'genesis_after_header', 'genesis_featured_box' );
function genesis_featured_box() {
if ( is_front_page() && is_active_sidebar( 'featured-box' ) ) {
       genesis_widget_area( 'featured-box', array(
        'before' => '<div class="featured-box widget-area">',
        'after'  => '</div>',
    ) );

}}

And here’s my CSS

.featured-box {
    -moz-border-radius: 10px;
    -webkit-border-radius: 10px;
    background-color: #000;
    color: #fff;
    border: 2px solid #ddd;
    border-radius: 10px;
    margin: 0 auto;
    margin-top: 10px;
    overflow: visible;
    padding: 20px;
    width: auto;
}

.featured-box h4 {
    font-size: 20px;
    color: #fff;

}

.featured-box p {
    padding: 0 0 20px;
}

.featured-box ul {
    margin: 0 0 20px;
}

.featured-box ul li {
    list-style-type: disc;
    margin: 0 0 0 30px;
    padding: 0;
    align: right;
}

.featured-box .enews p {
    padding: 10 10 10 10px;
    color: #fff;
      float: left;
      width: 220 px;
       margin: 10 10 10 10px;

}

.featured-box .enews #subscribe {
    padding: 20 20 20 20px;;

}

.featured-box .enews #subbox {
    background-color: #fff;
    margin: 0;
    width: 300px;

}

.featured-box .enews .myimage {

      float: right;
      margin-left: 10px;
      margin-right: 10px;
          width: auto;
}

.featured-box .enews input[type="submit"] { 
background-color: #d60000;
     padding: 10 10 10 10px;
      width: 150px;

}

.widget li {

border-bottom: none;
}

My problem is the top of feature box disappears beneath the navbar when I expand my browser window. You can see it here: http://bryancollins.eu/wp/.

How can I fix this? And is this easy to make this feature box responsive?

Thanks for the help.

  • 写回答

1条回答 默认 最新

  • dongwenghe2416 2014-04-19 11:52
    关注

    Try adjusting the margins with media queries:

    @media screen and (min-width: 1024px) and (max-width: 1139px) {
        div.featured-box {
            margin-top: 135px;
        }
    }
    
    @media screen and (min-width: 1140px) {
        div.featured-box {
            margin-top: 70px;
        }
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?