【问题标题】:How to increase size of logo in header on Wordpress site如何在 Wordpress 网站的标题中增加徽标的大小
【发布时间】:2017-08-02 13:39:25
【问题描述】:

我在我的网站www.theestablishmenthairdressing.com 的标题中添加了一个徽标,但是它非常小(左上角的徽标)。

我可以通过检查Safari 中的代码看到,主题中内置的徽标的大小似乎受到限制:

<h1 class="header-logo">
   <a href="http://www.theestablishmenthairdressing.com/" rel="home">
      <img class="" width="50" height="50" src="//www.theestablishmenthairdressing.com/wp-content/uploads/2017/08/Establishment-LOGO-header.png" alt="The Establishment Hairdressing" />                        
   </a>
</h1>

但是我不清楚如何改变这一点。我试过添加 CSS

h1.header-logo {
    width: 200px !important;
}

对于子主题的 style.css,但这并没有什么不同。

请帮帮我。

【问题讨论】:

    标签: html css wordpress


    【解决方案1】:

    将文件复制到此代码可能为header.php 的子主题文件夹中,并从img 标记中删除width="50" height="50"。现在您可以在style.css 中进行更改。

    【讨论】:

    • 我找到了 php 文件(实际上是在父主题的“headers”文件夹中,因为有几个标题变体)。我将文件复制到子主题,但没有覆盖父主题,所以最后只是备份了父 php 文件并直接编辑它,似乎工作正常。谢谢你的回答:)。
    【解决方案2】:

    你应该像下面这样使用。

        h1.header-logo img {
            width: 200px !important;
        }
    

    h1.header-logo>a>img {
            width: 200px !important;
        }
    

    【讨论】:

      【解决方案3】:

      只要去掉图片标签的宽高属性即可:

      <img class="" src="//www.theestablishmenthairdressing.com/wp-content/uploads/2017/08/Establishment-LOGO-header.png" alt="The Establishment Hairdressing">
      

      它应该可以正常工作。

      【讨论】:

        【解决方案4】:

        http://wpdemos.themezaa.com/pofo/documentation/knowledgebase/logo-typography-and-colors/change-logo-size/

        标题标志代码

        header a.logo-light img{ max-height: 26px;}
        

        粘性标题标志代码

        header a.logo-dark img {max-height: 26px;}
        

        页脚标志代码

        .footer-logo { max-height: 26px; }
        

        汉堡标志代码

        .hamburger-logo img { max-height: 46px; }
        

        【讨论】:

          猜你喜欢
          • 2019-06-04
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2020-08-27
          • 2016-04-29
          • 2022-01-02
          • 1970-01-01
          • 2021-05-26
          相关资源
          最近更新 更多