wordpress - 我网站上唯一响应的部分?

标签 wordpress twitter-bootstrap css responsive-design responsive

<分区>

我用 bootstrap 构建了一个 WordPress 主题,整个页面都是响应式的,除了我无法响应的部分是下面的部分:

.showcase {
  height: 600px;
  padding: 100px 20px;
  text-align: center;
  border-bottom: #ccc 1px solid;
  margin-bottom: 30px;
  color: #fff;
}

.showcase h1 {
  font-size: 35px;
  padding-bottom: 20px;
  color: #fff;
}

.showcase p {
  font-size: 20px;
  margin-bottom: 50px;
}
<section class="showcase">
  <div class="container">
    <h1>
      <?php echo get_theme_mod('showcase_heading', 'Jon Doe'); ?>
    </h1>
    <p>
      <?php echo get_theme_mod('showcase_text', 'Making The Tractors Work For You!'); ?>
    </p>
    <a href="<?php echo get_theme_mod('btn_url', '#'); ?>" class="btn btn-primary btn-lg">
      <?php echo get_theme_mod('btn_text', 'Read More'); ?>
    </a>
  </div>
</section>

Screenshot

任何帮助或提示将不胜感激,谢谢。

最佳答案

将 background-size: cover 添加到 .showcase div 中的图像,以便它填充它的容器。使用媒体查询根据屏幕宽度修改图像的位置,或者换入在该屏幕宽度下看起来更好的新图像。下面是一些让您入门的代码:

.showcase {
  background: url(http://www.web2dezine.com/wp-content/uploads/2017/12/showcase.jpg) no-repeat center center;
  background-size: cover;
}
@media screen and (max-width:480px) {
  // modified image styles for mobile here
}

关于wordpress - 我网站上唯一响应的部分?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48083077/

上一篇:html - 在 Angular 模板中对齐 2 个 <ul> block

下一篇:jquery - 使用 java 在不同屏幕尺寸之间更改导航菜单 HTML?

相关文章:

php - 将 Woocommerce 分类归档页面标题替换为 ACF 自定义字段

mysql - 数据库通过 phpMyAdmin 不可见

html - Bootstrap 中的垂直对齐元素

html - 两个盒子的背景颜色相同(左和右),但左框内容很多,右框内容很少?

php - 如何删除通过类添加的操作

wordpress - Paypal 支付标准默认输入卡详细信息

html - 如何让文本在换行符处对称排列

ruby-on-rails - 使用 Rails 5 的 Bootstrap4

javascript - 如何保存Chrome的Coverage工具分析的结果?

html - 将字段集中的图例移动到表单下方