-6ren">
gpt4 book ai didi

php - 菜单和搜索区域内联问题

转载 作者:太空宇宙 更新时间:2023-11-04 12:32:32 26 4
gpt4 key购买 nike

该站点看起来很糟糕,因为搜索区域和菜单不在同一行。任何人都可以指导我如何使这个搜索区域与菜单内联吗?请指导。谢谢。我的网站: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 -->

enter image description here

最佳答案

enter image description here

编辑

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

关于php - 菜单和搜索区域内联问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27542704/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com