首页 > Web开发 > 详细

html 固定居中

时间:2020-04-30 10:24:40      阅读:60      评论:0      收藏:0      [点我收藏+]

fixed 居定居中

<div style="position:fixed;top: 50%;left: 50%;transform: translate(-50%, -50%);width:500px;height:500px;border:1px solid red;z-index:99;">
        居中显示的内容
    </div>

遮挡层

<div style="position: absolute;margin: 0;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2200px;
    position: absolute;
    background-color: #000;
    filter: alpha(opacity=70);
    z-index: 98;
    overflow: hidden;
    opacity: 0.7;"></div>

html 固定居中

原文:https://www.cnblogs.com/zhenzi0322/p/12807105.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!