包装类的CSS背景不起作用

时间:2013-09-26 12:03:25

标签: html css drupal width background-color

我正在尝试修改Drupal菜单:page.tpl.php

<?php if ($main_menu): ?>
        <div id="navigation-wrapper">
            <div id="navigation">

                <nav id="main-menu" role="navigation" tabindex="-1">
                  <?php
                  // This code snippet is hard to modify. We recommend turning off the
                  // "Main menu" on your sub-theme's settings form, deleting this PHP
                  // code block, and, instead, using the "Menu block" module.
                  // @see https://drupal.org/project/menu_block
                  print theme('links__system_main_menu', array(
                    'links' => $main_menu,
                    'attributes' => array(
                      'class' => array('links', 'inline', 'clearfix'),
                    ),
                    'heading' => array(
                      'text' => t('Main menu'),
                      'level' => 'h2',
                      'class' => array('element-invisible'),
                    ),
                  )); ?>
                </nav>


              <?php print render($page['navigation']); ?>
            </div>
        </div>
        <?php endif; ?>

而css是:

#navigation-wrapper{
    overflow:hidden;
    width:100%
    background:#ff6005;

}
#navigation{
    width:950px;
    margin:0 auto;
    background:#ff6005;
}
#navigation ul li
{
    display:inline;
    padding:5px 10px 6px 10px;  
}

但是我的输出仅为div navigation生成背景颜色!我期待背景颜色覆盖全宽。我的CSS&gt;

有什么问题

1 个答案:

答案 0 :(得分:2)

#navigation-wrapper{
    overflow:hidden;
    width:100%;
    background:#ff6005;

您在宽度后错过了;