我试着用CSS将我的网站徽标居中,但什么都没有改变。当使用Kalium主题时,有没有办法将网站徽标放在标题的中央?
发布于 2019-05-12 19:22:04
我认为这取决于您正在使用的头文件。但据我所知,它们都是使用flex布局构建的。
下面给你一个主布局的例子:https://demo.kaliumtheme.com/main/
在这种情况下,您只需将flex-direction设置为column,将justify-content设置为center
header.main-header .logo-and-menu-container {
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
}此外,我会给徽标一些margin-bottom
.header-logo.logo-image {
margin-bottom: 30px;
}瞧,看起来很不错。
发布于 2019-08-17 23:52:07
尝试以下代码:
header.main-header .logo-and-menu-container
{
display:block;
margin-left:auto;
margin-right:auto
}https://stackoverflow.com/questions/56092578
复制相似问题