【问题标题】:How can you center a logo on a Kalium Theme on Wordpress?如何在 Wordpress 上将徽标置于 Kalium 主题上?
【发布时间】:2019-09-29 05:55:56
【问题描述】:

我尝试使用 CSS 将我的网站徽标居中,但没有任何改变。使用 Kalium 主题时,有没有办法让网站徽标居中?

【问题讨论】:

    标签: css wordpress wordpress-theming


    【解决方案1】:

    我认为这取决于您使用的标头。但据我所知,它们都是用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;
    }
    

    瞧,看起来不错。

    【讨论】:

      【解决方案2】:

      试试这个代码:

      header.main-header .logo-and-menu-container
       {
          display:block;
          margin-left:auto;
          margin-right:auto
      }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-11-23
        • 2018-04-21
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多