Twitter bootstrap 应用于卡体中图像的卡的不透明度设置

Twitter bootstrap 应用于卡体中图像的卡的不透明度设置,twitter-bootstrap,opacity,laravel-5.8,Twitter Bootstrap,Opacity,Laravel 5.8,我有一个背景图像覆盖了我正在处理的主页的整个页面,希望用户能够通过内容看到bg图像。我在页面上将卡片作为列,并将其设置为0.8不透明度。我遇到的问题是,这种不透明度也适用于卡体中包含的任何图像。你可以通过它们看到背景图像 我试过制作 一些文本一些文本一些文本一些文本一些文本一些文本一些文本一些文本一些文本一些文本一些文本一些文本 一些文本一些文本一些文本一些文本一些文本一些文本一些文本一些文本一些文本一些文本一些文本一些文本 我深入研究了opacity命令,它会影响父元素中包含的元素。因此,0.

我有一个背景图像覆盖了我正在处理的主页的整个页面,希望用户能够通过内容看到bg图像。我在页面上将卡片作为列,并将其设置为0.8不透明度。我遇到的问题是,这种不透明度也适用于卡体中包含的任何图像。你可以通过它们看到背景图像

我试过制作

一些文本一些文本一些文本一些文本一些文本一些文本一些文本一些文本一些文本一些文本一些文本一些文本

一些文本一些文本一些文本一些文本一些文本一些文本一些文本一些文本一些文本一些文本一些文本一些文本


我深入研究了opacity命令,它会影响父元素中包含的元素。因此,0.8的不透明度将应用于该元素的所有子元素。方法是使用背景色

i、 e.将CSS更改为:

// CSS
// Translucent foreground
.card.t-lucent {
    opacity: 0.8;
}

// Home full body background
.home-bg { 
  background: url(img/bg/world-war-ii-60541_1920.jpg) no-repeat center center fixed; 
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
}

// Newspaper
.newspaper {
    font-family: 'Belgrano', serif;
}

// HTML
<body class="{{ request()->path() }}-bg">
<div class="card t-lucent newspaper">
            <div class="card-body">
                <h1 class="card-title text-center display-4">
                    Welcome!
                </h1>
                <img class="img rounded float-left mr-3 opq-img" src="{{ asset('img/ww1_soldier_statue.jpg') }}" alt="WW1 soldier statue" />
                <p class="card-text">some text some text some text some text some text some text some text some text some text</p>

                <p class="card-text">some text some text some text some text some text some text some text some text </p>
            </div>
        </div>
</body>

我深入研究了opacity命令,它会影响父元素中包含的元素。因此,0.8的不透明度将应用于该元素的所有子元素。方法是使用背景色

i、 e.将CSS更改为:

// CSS
// Translucent foreground
.card.t-lucent {
    opacity: 0.8;
}

// Home full body background
.home-bg { 
  background: url(img/bg/world-war-ii-60541_1920.jpg) no-repeat center center fixed; 
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
}

// Newspaper
.newspaper {
    font-family: 'Belgrano', serif;
}

// HTML
<body class="{{ request()->path() }}-bg">
<div class="card t-lucent newspaper">
            <div class="card-body">
                <h1 class="card-title text-center display-4">
                    Welcome!
                </h1>
                <img class="img rounded float-left mr-3 opq-img" src="{{ asset('img/ww1_soldier_statue.jpg') }}" alt="WW1 soldier statue" />
                <p class="card-text">some text some text some text some text some text some text some text some text some text</p>

                <p class="card-text">some text some text some text some text some text some text some text some text </p>
            </div>
        </div>
</body>