【发布时间】:2019-09-29 05:55:56
【问题描述】:
我尝试使用 CSS 将我的网站徽标居中,但没有任何改变。使用 Kalium 主题时,有没有办法让网站徽标居中?
【问题讨论】:
标签: css wordpress wordpress-theming
我尝试使用 CSS 将我的网站徽标居中,但没有任何改变。使用 Kalium 主题时,有没有办法让网站徽标居中?
【问题讨论】:
标签: css wordpress wordpress-theming
我认为这取决于您使用的标头。但据我所知,它们都是用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;
}
瞧,看起来不错。
【讨论】:
试试这个代码:
header.main-header .logo-and-menu-container
{
display:block;
margin-left:auto;
margin-right:auto
}
【讨论】: