irpas技术客

css实现两图片浮动自适应居中显示_Mr-Bean_css图片浮动

网络投稿 1376

效果图:

HTML: <div class="propAd" v-if="prop_ad_shade_img"> <image src="/static/img/propAd.png" mode="widthFix" class="prop_ad_img"></image> <image src="/static/img/propAdClose.png" mode="widthFix" class="prop_ad_close" @click="closeAd()"></image> </div> .propAd { display: flex; flex-direction: column; justify-content: center; align-items: center; .prop_ad_img { position: fixed; z-index: 999; top: 150px; width: 300px; height: 372px } .prop_ad_close { position: fixed; z-index: 999; top: 542px; width: 40px; height: 40px; } }

横向居中用flex布局,纵向居中只能用绝对定位控制。


1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,会注明原创字样,如未注明都非原创,如有侵权请联系删除!;3.作者投稿可能会经我们编辑修改或补充;4.本站不提供任何储存功能只提供收集或者投稿人的网盘链接。

标签: #css图片浮动 #效果图HTMLampltdiv