htmlcssdrupalwidthbackground-color

CSS background to wrapper class not working


I am trying to modify the Drupal menu: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; ?>

And the css is:

#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;  
}

But my output produces the background color only for the div navigation ! I was expecting a background color covering full width . Whats wrong with my CSS >


Solution

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

    You missed a ; after width.