z-index分隔同一div内的背景颜色和图标

时间:2018-05-18 08:01:00

标签: html css bootstrap-4

为class =“content”创建div givng背景颜色 现在我将描述数据必须显示的顺序 1,背景颜色在上面 2,图标内的图标 3,标题和段落

<div class="col col-md-4">
                <div class="content bg-secondary" style="z-index: 0">
                    <div class="test">

                    <span>
                        <i class="fa fa-meetup fa-2x" aria-hidden="true"></i>
                        <i class="fa fa-meetup" aria-hidden="true" style="font-size: 175px; z-index: 2 !important; position: absolute;"></i>
                  </span>
                        </div>
                    <div class="testt">
                    <h3 style="z-index: 4 !important;">Heading 1</h3>
                    <p style="z-index: 6 !important;"> content is entered here  entered here  entered here </p>
                        </div>
                </div>
            </div>

1 个答案:

答案 0 :(得分:0)

参考此链接 https://bootsnipp.com/snippets/eNxGv z-index仅在您在该属性中申请位置或从那里获取位置时才有效,即父属性