1、html中将需要加背景图的div(other-product)包裹住定位文字的div(other-product-box)和遮罩层的div(indexInner)

2、设置最外边框CSS样式

.other-product{
    position: relative;
    background-size: 100%;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    min-height: 675px;
    background-size: 100%;
}

3、设置遮罩层的CSS样式

.indexInner{
    background: rgba(0,0,0,0.4);
    height: 675px;
    width: 100%;
    position: absolute;
    left: 0;
    top: 0;
    z-index: 2;
}

4、设置最上层文字div的CSS样式

.other-product-box{
    position: absolute;
    margin: 0 auto;
    width: 100%;
    -webkit-box-sizing: border-box;
    padding: 0 10px;
    z-index: 999;
    max-width: 1180px;
    left: 152px;
}

5、完结

Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐