【发布时间】:2016-01-24 18:47:22
【问题描述】:
我将我的主题从 24 延伸。我现在有这个头文件:
<header id="masthead" class="site-header" role="banner">
<div class="header-main">
<img class="site-logo" src="<?php echo bloginfo('stylesheet_directory');?>/images/ic_logo.png" alt="Image" width="32" height="32"/>
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
<div class="search-toggle">
<a href="#search-container" class="screen-reader-text" aria-expanded="false" aria-controls="search-container"><?php _e( 'Search', 'twentyfourteen' ); ?></a>
</div>
<nav id="primary-navigation" class="site-navigation primary-navigation" role="navigation">
<button class="menu-toggle"><?php _e( 'Primary Menu', 'twentyfourteen' ); ?></button>
<a class="screen-reader-text skip-link" href="#content"><?php _e( 'Skip to content', 'twentyfourteen' ); ?></a>
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu', 'menu_id' => 'primary-menu' ) ); ?>
</nav>
</div>
<div id="search-container" class="search-box-wrapper hide">
<div class="search-box">
<?php get_search_form(); ?>
</div>
</div>
</header>
标志图像的 CSS 类:
.site-logo {
float: left;
}
基本主题 CSS 样式:
.site-title {
float: left;
font-size: 18px;
font-weight: 700;
line-height: 48px;
margin: 0;
/* Nav-toggle width + search-toggle width - gutter = 86px */
max-width: -webkit-calc(100% - 86px);
max-width: calc(100% - 86px);
}
.site-title a,
.site-title a:hover {
color: #fff;
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
但是标识在网站名称上方显示...
如何将其对齐为单个字符串?
【问题讨论】:
-
这是
logotype? -
这个
<img class="site-logo" src="<?php echo bloginfo('stylesheet_directory');?>/images/ic_logo.png" alt="Image" width="32" height="32"/>在我的主题文件夹中。 -
所以你想要
h1和图像/标志一行一行? -
是的,我需要在文字(网站名称)之后显示徽标和文字。
标签: php html css wordpress-theming