该站点看起来很糟糕,因为搜索区域和菜单不在同一行。任何人都可以指导我如何使这个搜索区域与菜单内联吗?请指导。谢谢。我的网站:http://www.amp.com.pk/
<header id="branding" role="banner">
<div class="header-wrapper">
<a href="<?php home_url(); ?>"><img style="width:750px;" src="http://www.amp.com.pk/wp-content/uploads/2014/12/headeramp.png"></a>
<hgroup>
<h1 onClick="location.href='<?php echo esc_url( home_url( '/' ) ); ?>'" id="site-title"><span><?php bloginfo( 'name' ); ?></h1>
<h2 id="site-description">Adnan Malik Productions</h2>
<h2 id="site-description"><?php bloginfo( 'description' ); ?></h2>
</hgroup>
<?php
// Has the text been hidden?
if ( 'blank' == get_header_textcolor() ) :
?>
<div class="only-search<?php if ( ! empty( $header_image ) ) : ?> with-image<?php endif; ?>">
<?php get_search_form(); ?>
</div>
<?php
else :
?>
<?php get_search_form(); ?>
<?php endif; ?>
<nav id="access" role="navigation">
<?php /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff. */ ?>
<div class="skip-link"><a class="assistive-text" href="#content" title="<?php esc_attr_e( 'Skip to primary content', 'twentyeleven' ); ?>"><?php _e( 'Skip to primary content', 'twentyeleven' ); ?></a></div>
<div class="skip-link"><a class="assistive-text" href="#secondary" title="<?php esc_attr_e( 'Skip to secondary content', 'twentyeleven' ); ?>"><?php _e( 'Skip to secondary content', 'twentyeleven' ); ?></a></div>
<?php /* Our navigation menu. If one isn't filled out, wp_nav_menu falls back to wp_page_menu. The menu assiged to the primary position is the one used. If none is assigned, the menu with the lowest ID is used. */ ?>
<?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>
</nav><!-- #access -->
</div>
</header><!-- #branding -->
编辑
从 .only-search
中移除 position:absolute
编辑#2
将 margin-top:0
设置为 #branding #s
将 position: relative
设置为 #access
并放置在搜索元素内。现在,给出:
div.only-search {
position: absolute;
top: 0;
right: 0
}
或设置:
#searchform #s {
position: relative;
top: 20px;
}
我是一名优秀的程序员,十分优秀!