0

我不知道如何让 DIV 出现在它下面的 DIV 上。换句话说,我的网页有一个头部,一个向左浮动的 DIV 和一个向右浮动的 DIV。下面是一个菜单栏。我没有很多菜单项,所以我希望 DIV 中的图像向右浮动以部分重叠菜单栏。我能够使其与绝对定位一起工作......但这并不理想。我继续并更改了菜单栏的宽度,但这更像是临时修复以获得我想要的东西。想法?

www.sacspartans.org

<div id="page" class="hfeed site">
<header id="masthead" class="site-header" role="banner">
    <div id="header-left">      
            <hgroup>
        <h1 class="site-title">
            <a href="<?php echo esc_url( home_url( '/' ) ); ?>">
            <img src="http://sacspartans.org/wp-        
                             content/uploads/2013/05/banner.png" alt="SacSpartans" 
                             title="SacSpartans" border="0" />
            </a>
        </h1>
        <h2 class="site-description"><?php bloginfo( 'description' ); ?> 
                    </h2>
            </hgroup>
    </div>  
    <div id="header-right"> 
        <img src="http://sacspartans.org/wp-
                    content/uploads/2013/05/california1.png" alt="MSU Alumni Club of 
                    the Sacramento Valley" title="MSU Alumni Club of the Sacramento  
                    Valley" border="0" />
    </div>
    <div id="navigation-bar">
    <nav id="site-navigation" class="main-navigation" role="navigation">
        <h3 class="menu-toggle"><?php _e( 'Menu', 'twentytwelve' ); ?></h3>
        <a class="assistive-text" href="#content" title="<?php esc_attr_e( 
                    'Skip to content', 'twentytwelve' ); ?>"><?php _e( 'Skip to 
                    content', 'twentytwelve' ); ?></a>
        <?php wp_nav_menu( array( 'theme_location' => 'primary', 
                    'menu_class' => 'nav-menu' ) ); ?>
    </nav>
    </div>

现在是 CSS 信息。

/* Header */
#header-left {
float: left;
}

#header-right {
float: right;
margin-top: 0;
}

#navigation-bar {
width: 575px;
}
4

0 回答 0