设置遮罩层样式

如下图
在这里插入图片描述
html代码如下

//这段代码放置所有代码最前面
<view class="FEX">
	<view class="pop">
		<image src="{{'https://statics.zhuishushenqi.com'+data1.cover}}" class="tupi"></image>
	</view>
</view>

css代码

.FEX{
  position:fixed;
  z-index: 99;
  background: rgb(0, 0, 0,0.3);
  width: 100%;
  height: 100%;

  border: 1PX solid firebrick;

}

.pop {
  position: fixed;
  /* background: black; */
  top: 50%;
  left: 50%;
  height: 70%;
  width: 70%;
  z-index: 1000;

}

.tupi {
  position: relative;
  top: -50%;
  left: -50%;
  width: 100%;
  height: 100%;

}

版权声明:本文为IT_iosers原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。