css - 调整移动标题图片的大小

标签 css wordpress header

我一直在尝试为我的 WordPress 博客设置标题图片,但随着图片变小,我无法让它在小屏幕上正常工作。

此外,当您在移动版本上单击菜单时,图像会下降。

<header id="masthead" class="site-header" style="background-image: url(<?php header_image(); ?>);background-repeat:no-repeat; background-size:contain; background-position:center;">

.site-branding {
      padding: 85px 0;
    }

header.site-header{
        margin-bottom: 40px;
    }

引用博客:http://semdesculpas.org/

最佳答案

您可以为 site-branding 设置背景。

    <div class="site-branding  row text-center" style="background-image: url(http://semdesculpas.org/wp-content/uploads/2018/01/cropped-cropped-Untitled-1-1-1-2.png);background-repeat:no-repeat;
background-size:contain;
background-position:center; margin-top: 20px">

结果:

enter image description here

关于css - 调整移动标题图片的大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48197820/

相关文章:

html - 导航菜单栏内的图标放置及其标题的放置问题

html - 有没有办法在没有 jQuery/javascript 的情况下将元素与其 'grandparent' 对齐?

html - 为什么单击 div 会检查隐藏的单选按钮?

html - 当不需要在嵌入到另一个 html 页面的 html 页面上滚动时删除滚动条

php - 在 wordpress 简码内的正文末尾添加 css

php - wordpress 网站上的 Firebase 身份验证

CSS,中心菜单

c++ - 迁移到 Xcode,现在有很多 "is not member of std"和一些其他 header 问题

css - 样式化 DataPager

javascript - 反点击劫持代码导致页面不断刷新