css - 色轮中的数字与我的弹出窗口重叠

标签 css html user-interface popup

enter image description here

一旦我按下一个按钮让弹出窗口出现,弹出窗口将覆盖整个 GUI,除了色轮中的数字,如下图所示。我可以使用什么方法来防止数字与弹出窗口重叠?

CSS:

.overlay {
    background-color: rgba(0, 0, 0, 0.6);
    bottom: 0;
    cursor: default;
    left: 0;
    opacity: 0;
    position: fixed;
    right: 0;
    top: 0;
    visibility: hidden;
    z-index: 0;

    -webkit-transition: opacity .5s;
    -moz-transition: opacity .5s;
    -ms-transition: opacity .5s;
    -o-transition: opacity .5s;
    transition: opacity .5s;
}
.overlay:target {
    visibility: visible;
    opacity: 1;
}
.popup h2{color:#07839f; line-height:1.8em}
.popup {
    background-color: #fff;
    border: 3px solid #fff;
    display: inline-block;
    left: 50%; color:#666;
    opacity: 0;
    padding: 15px;
    position: fixed;
    text-align: justify;
    top: 40%;
    visibility: hidden;
    z-index: 10;

    -webkit-transform: translate(-50%, -50%);
    -moz-transform: translate(-50%, -50%);
    -ms-transform: translate(-50%, -50%);
    -o-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);

    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
    -ms-border-radius: 10px;
    -o-border-radius: 10px;
    border-radius: 10px;

    -webkit-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset;
    -moz-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset;
    -ms-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset;
    -o-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset;
    box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset;

    -webkit-transition: opacity .5s, top .5s;
    -moz-transition: opacity .5s, top .5s;
    -ms-transition: opacity .5s, top .5s;
    -o-transition: opacity .5s, top .5s;
    transition: opacity .5s, top .5s;
}
.overlay:target+.popup {
    top: 50%;
    opacity: 1;
    visibility: visible;
}
.close {
    background-color: rgba(0, 0, 0, 0.8);
    height: 30px;
    line-height: 30px;
    position: absolute;
    right: 0;
    text-align: center;
    text-decoration: none;
    top: -15px;
    width: 30px;

    -webkit-border-radius: 15px;
    -moz-border-radius: 15px;
    -ms-border-radius: 15px;
    -o-border-radius: 15px;
    border-radius: 15px;
}
.close:before {
    color: rgba(255, 255, 255, 0.9);
    content: "X";
    font-size: 24px;
    text-shadow: 0 -1px rgba(0, 0, 0, 0.9);
}

.popup p, .popup div {
    margin-bottom: 10px;
}
.popup label {
    display: inline-block;
    text-align: left;
    width: 180px;
    color:black;
}
.popup input[type="text"], .popup input[type="number"] {
    margin: 0;
    padding: 4px; background:#d8f6fd;

    border: 1px solid #66c8de;
    -moz-box-shadow: 0 1px 1px #ddd inset, 0 1px 0 #fff;
    -webkit-box-shadow: 0 1px 1px #ddd inset, 0 1px 0 #fff;
    box-shadow: 0 1px 1px #ddd inset, 0 1px 0 #fff;
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
    border-radius: 3px;
}

#sync{
    -webkit-border-radius: 28;
    -moz-border-radius: 28;
    border-radius: 28px;
    font-family: Georgia;
    color: #ffffff;
    background: #34b8d9;
    padding: 10px 20px 10px 20px;
    outline:0;
}

最佳答案

您可以将 css 属性 z-index 添加到弹出窗口和零号。您需要将 position: relative; 添加到两个 class(es)/id(s),但 z-index 才能工作。

关于css - 色轮中的数字与我的弹出窗口重叠,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31799543/

相关文章:

javascript - 根据所选类别隐藏或显示 LI(过滤器)

html - 有人打印网页时的服务器端日志记录

屏幕中间的 Flutter Tab View

java - 在 Java 打印对话框中隐藏 "Print to file"

html - 如何将背景图像对齐到 h1 中居中文本的左侧?

jquery - $(window).height() 似乎不准确

javascript - 为什么我的圈子不动,代码似乎是正确的

jquery - 图层 slider 导航位置

html - 将背景图像添加到列表项

multithreading - 关于COM多线程和STA/MTA的问题