【问题标题】:change twitter bootstrap carousel background?更改 twitter 引导轮播背景?
【发布时间】:2017-07-12 04:03:24
【问题描述】:

如何更改 Twitter Bootstrap 3 轮播背景?

我想要的是标准的红色背景。 然后,每个轮播图像将被放置在这个红色背景之上。 只需更改标签的 css 就会给我红色背景,但轮播图像不会显示出来。

@import url("bootstrap.min.css");

body {
  background-image:url('../images/red_background.png')
}

【问题讨论】:

  • 尝试背景色:红色;这样您就不会覆盖背景图像声明。虽然我不确定 body 标签与轮播有什么关系。
  • 你能在你的 style.css 中覆盖.carousel 吗?
  • 还要确认您的图片路径是否正确...(即它真的在../images/ 中吗?(从您的页面所在的位置)

标签: css twitter-bootstrap


【解决方案1】:

您可以尝试像这样覆盖.carousel

    .carousel {
        background: url(http://placehold.it/620x420/ff9900);
        position: relative;
        padding: 10px;     /* Shows as a border around the carousel */
    }

填充只是为了使背景色的存在变得明显。

DEMO

【讨论】:

    【解决方案2】:

    .carousel{ 背景颜色:红色 }

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-03-30
      • 2020-02-10
      • 2013-10-28
      • 2021-02-21
      • 1970-01-01
      • 1970-01-01
      • 2018-06-29
      相关资源
      最近更新 更多