Changing Jumbotron opacity and make it full width without affecting the font and button

后端 未结 2 1351
旧时难觅i
旧时难觅i 2021-01-27 07:31

would like to ask how to change Jumbotron opacity and make it full width without affecting the opacity of the font and the button?

.jumbotron-special{
    text-a         


        
2条回答
  •  佛祖请我去吃肉
    2021-01-27 08:14

    You can add the background in another element and decrease the opacity only for that element:

    .jumbotron-special {
       position: relative;
    }
    .jumbotron-special:after {
        content : "";
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        background-image: url('header-bg.jpg'); 
        width: 100%;
        height: 100%;
        opacity : 0.3;
        z-index: -1;
    }
    

提交回复
热议问题