我想把标题(黄色背景)缩小。正如我所知,标题上有太多空间,因此用户必须继续滚动才能获得内容。那有意义吗?无需更改图像的高度。因为它看起来很奇怪(http://cultsotters.org.uk)。这可能吗?我到处搜索,似乎这可能是不可能的。
长篇大论道歉。
Css代码
#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/CultsOttersORIG.svg');
background-size: 105px 115px;
width: auto;
background-repeat: no-repeat;
background-position:top center;
display: block;
text-align: center;
padding: 2.306em 0 0;
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;
}
#site-title {
padding: 2.306em 0 0;
}
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 ?>
答案 0 :(得分:1)
您可以使用css:
更改标题的高度.branding {
height: 300px;
}
答案 1 :(得分:0)
从custom-style.css的第483行删除#site-title的填充
答案 2 :(得分:0)
取出
#site-title > span > a {
line-height: 100px;
}