更改 twitter bootstrap carousel 背景? [英] change twitter bootstrap carousel background?

查看:36
本文介绍了更改 twitter bootstrap carousel 背景?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

How do you change the Twitter Bootstrap 3 carousel background?

我想要的是标准的红色背景.然后,每个轮播图像将被放置在这个红色背景之上.简单地更改标签的 css 会给我红色背景,但轮播图像不会显示.

What I want is a standard red background. Then, each carousel image will be put on top of this red background. Simply changing the tag's css gives me the red background, but then carousel images don't show up.

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

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

推荐答案

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

You can try to overwrite .carousel like this:

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

填充只是为了使 bg 颜色的存在显而易见.

The padding is there only to make the presence of the bg-colour obvious.

演示

这篇关于更改 twitter bootstrap carousel 背景?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆