集中与主屏幕宽度和高度相关的弹出窗口

问题描述 投票:0回答:1

我创建了弹出窗口并将它们链接到页脚中,当用户单击并出现弹出窗口时,无论屏幕大小,它都应该水平和垂直居中于我的屏幕。在弹出窗口保留之前,没有任何内容可以点击。现在的问题是我的弹出窗口以整个页面高度为中心,而不是当前屏幕高度

.popup .content{
    position: absolute;
    inset: 0;
    margin: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50% , -50%)scale(0);
    background: white;
    color: black;
    width: 1000px;
    height: 500px;
    z-index: 1000;
    text-align: justify;
    box-sizing: border-box;
    border-radius: 32px;
}

popup

javascript html css html5-canvas css-transitions
1个回答
0
投票

您可以通过从变换属性中删除比例来集中弹出窗口。

© www.soinside.com 2019 - 2024. All rights reserved.