我是Wordpress的新手,并将Skilt-Theme用于我的新博客。现在我遇到了自定义徽标和侧边栏切换的问题。
没有徽标: Click
使用徽标: Click
如您所见:上传自定义徽标时,侧边栏切换正在向下移动。将整个菜单放在与上传徽标之前相同的位置会很不错。希望你能找到解决问题的方法。
CSS:
.site-header {
position: relative;
z-index: 100;
padding: 30px 0;
padding: 3rem 0;
}
.site-header a {
color: inherit;
}
.site-title {
line-height: 1;
margin: 0;
}
.site-description {
margin: 0;
}
@media screen and (min-width: 480px) {
.site-title,
.site-description {
display: inline-block;
vertical-align: middle;
}
.custom-logo {
display: inline-block !important;
vertical-align: middle;
}
.site-description {
margin: 0 0 0 10px;
}
}
.site-branding {
float: left;
}
.site-navigation-toggle {
color: #252931;
right: 0;
line-height: 1;
z-index: 9000;
font-size: 30px;
font-size: 3rem;
-moz-transition: opacity 150ms;
-o-transition: opacity 150ms;
-webkit-transition: opacity 150ms;
transition: opacity 150ms;
}
.site-navigation-toggle .fa-bars {
position: relative;
top: -3px;
max-height: 25px;
display: inline-block;
overflow: hidden;
}
.custom-logo {
display: block;
max-width: 100%;
background-repeat: no-repeat;
background-size: contain;
background-position: center center;
}
.custom-logo a {
display: block;
width: 100%;
height: 0;
font: 0/0 a;
text-decoration: none;
text-shadow: none;
color: transparent;
}
.site-main {
display: block;
}
.single .site-main, .page .site-main {
background-color: #fff;
padding: 30px;
padding: 3rem;
}
.has-background .site-header,
.has-background .site-footer,
.has-background .social-links,
.has-background .paging-navigation,
.has-background .site-title {
color: #fff;
}
和标题代码:
<div class="site-branding">
<?php if ( stag_get_logo()->has_logo() ) : ?>
<div class="custom-logo">
<a rel="home" title="<?php esc_attr_e( 'Home', 'stag' ); ?>" href="<?php echo esc_url( home_url('/') ); ?>"></a>
</div>
<?php else: ?>
<h1 class="site-title"><a href="<?php echo esc_url( home_url() ); ?>"><?php bloginfo( 'name' ); ?></a></h1>
<?php endif; ?>
<?php $is_hiding = stag_theme_mod( 'title_tagline', 'hide-tagline' ); ?>
<p class="site-description"<?php if ( $is_hiding ) echo ' hidden'; ?>><?php bloginfo( 'description' ); ?></p>
</div>
<?php stag_maybe_show_primary_menu( 'header' ); ?>
<a href="#" id="site-navigation-toggle" class="site-navigation-toggle"><i class="fa fa-bars"></i></a>
</header
答案 0 :(得分:0)
此时我已经浏览了您的网站并找到了最简单的解决方案。
请从您的班级中删除此顶级css .site-navigation-toggle,.menu-header表示:
.site-navigation-toggle, .menu-header { position:absolute;top:50%;transform: translateY(-50%);}
这应该是这样的
.site-navigation-toggle, .menu-header { position:absolute;transform: translateY(-50%);}
刚删除顶部:50%,一切都会好的..