dongpu4141 2014-11-18 20:59
浏览 63
已采纳

减少徽标和搜索字段之间的间距(WordPress Twenty Eleven)

I am trying to reduce the spacing between the search bar and logo (http://cultsotters.org.uk), using the child theme of Twenty Eleven.

As the spacing is too large.

Tried reducing the size of the banner image, although that doesn't seem to help

Any help, much appreciated.

Css Code:

#branding {border:none;}
#branding {background: #ffff88; /* Old browsers */
background: -moz-linear-gradient(top, #ffff88 0%, #ffff88 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffff88), color-stop(100%,#ffff88)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #ffff88 0%,#ffff88 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ffff88 0%,#ffff88 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #ffff88 0%,#ffff88 100%); /* IE10+ */
background: linear-gradient(to bottom, #ffff88 0%,#ffff88 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffff88', endColorstr='#ffff88',GradientType=0 ); /* IE6-9 */
margin:none;
}
/* logo above site title */
#site-title a {
    background: url('http://www.cultsotters.org.uk/images/cults_otters_black.png');
    background-repeat: no-repeat;
    background-position:top center;
    display: block;
   max-height: 100px;

padding-top:70px;
  text-align: center;
   width: auto;
line-height:30px;
font-size:30px;
}
#branding hgroup {
text-align: center; display: inline; margin:0; align:center;}
#site-title, #site-description {
    margin: ; text-align: center; 
    }
#site-title > span > a {
    line-height: 100px;
}

HTMl Code:

<body <?php body_class(); ?>>
<div id="page" class="hfeed">
    <header id="branding" role="banner">
            <hgroup>
                <h1 id="site-title"><span><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></span></h1>
                <h2 id="site-description"><?php bloginfo( 'description' ); ?></h2>
            </hgroup>

            <?php
                // Check to see if the header image has been removed
                $header_image = get_header_image();
                if ( $header_image ) :
                    // Compatibility with versions of WordPress prior to 3.4.
                    if ( function_exists( 'get_custom_header' ) ) {
                        /*
                         * We need to figure out what the minimum width should be for our featured image.
                         * This result would be the suggested width if the theme were to implement flexible widths.
                         */
                        $header_image_width = get_theme_support( 'custom-header', 'width' );
                    } else {
                        $header_image_width = HEADER_IMAGE_WIDTH;
                    }
                    ?>
            <a href="<?php echo esc_url( home_url( '/' ) ); ?>">
                <?php
                    /*
                     * The header image.
                     * Check if this is a post or page, if it has a thumbnail, and if it's a big one
                     */
                    if ( is_singular() && has_post_thumbnail( $post->ID ) &&
                            ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( $header_image_width, $header_image_width ) ) ) &&
                            $image[1] >= $header_image_width ) :
                        // Houston, we have a new header image!
                        echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
                    else :
                        // Compatibility with versions of WordPress prior to 3.4.
                        if ( function_exists( 'get_custom_header' ) ) {
                            $header_image_width  = get_custom_header()->width;
                            $header_image_height = get_custom_header()->height;
                        } else {
                            $header_image_width  = HEADER_IMAGE_WIDTH;
                            $header_image_height = HEADER_IMAGE_HEIGHT;
                        }
                        ?>
                    <img src="<?php header_image(); ?>" width="<?php echo $header_image_width; ?>" height="<?php echo $header_image_height; ?>" alt="" />
                <?php endif; // end check for featured image or standard header ?>
            </a>
            <?php endif; // end check for removed header image ?>

            <?php
                // Has the text been hidden?
                if ( 'blank' == get_header_textcolor() ) :
            ?>
                <div class="only-search<?php if ( $header_image ) : ?> with-image<?php endif; ?>">
                <?php get_search_form(); ?>
                </div>
            <?php
                else :
            ?>
                <?php get_search_form(); ?>
            <?php endif; ?>

            <nav id="access" role="navigation">
                <h3 class="assistive-text"><?php _e( 'Main menu', 'twentyeleven' ); ?></h3>
                <?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"><?php _e( 'Skip to primary content', 'twentyeleven' ); ?></a></div>
                <?php if ( ! is_singular() ) : ?>
                    <div class="skip-link"><a class="assistive-text" href="#secondary"><?php _e( 'Skip to secondary content', 'twentyeleven' ); ?></a></div>
                <?php endif; ?>
                <?php /* Our navigation menu. If one isn't filled out, wp_nav_menu falls back to wp_page_menu. The menu assigned to the primary location is the one used. If one isn't assigned, the menu with the lowest ID is used. */ ?>
                <?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>
  • 写回答

1条回答 默认 最新

  • drwkqwa82140 2014-11-18 21:03
    关注

    The ID #site-title has a lot of padding set at the top. If you reduce that it will tighten up the space.

    Try this:

    #site-title {
        padding: 2.306em 0 0;
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)
  • ¥15 AIC3204的示例代码有吗,想用AIC3204测量血氧,找不到相关的代码。