蒙层
利用z-index:
.mui-backdrop-other { position: fixed; top: 44px; right: 0; bottom: 0; left: 0; z-index: 2; background-color: rgba(0, 0, 0, .3); }
利用伪元素做蒙层:
.element { position: relative; } .element:after { content: "哈哈哈,我是遮罩"; position: absolute; top: 0; left: 0; width: 100%; height: 100%; box-sizing: border-box; padding: 100px; background-color: rgba(0, 0, 0, .6); color: #fff; text-align: center; }