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

后端 未结 2 1349
旧时难觅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 07:58

    See the following fiddle: http://jsfiddle.net/7ak3b0f4/

    Basically, have a parent element manage the page flow, make it relative, and create a child element for the background, and one for the content (order matters due to z-index, unless you manually change it). Then, have the children be absolutely positioned, and fill the entire parent.

    I'm in the background.

    Important stuff!

    and

    .jumbotron {
        width: 100%;
        height: 400px;
        position: relative;
    }
    
    .jumbotron .bg {
        opacity: 0.10;
        background-color: orange;
        position: absolute;
        width: 100%;
        height: 100%;
     }
    
    .jumbotron .content {
        position: absolute;
        width: 100%;
        height: 100%;
    }
    

提交回复
热议问题