Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
html表单背景覆盖_Html_Css - Fatal编程技术网

html表单背景覆盖

html表单背景覆盖,html,css,Html,Css,我有这个css代码: #ticket { background:rgba(139,137,137,0.7); } 我的表单ID为ticket 这是在表单上显示背景,但是文本输入、文本区域和选择输入并显示背景的“顶部” 如何使背景显示在所有元素之上?试试这个 #ticket{ display: block; width: 200px; height: 100px; background: green; position:

我有这个css代码:

#ticket {
        background:rgba(139,137,137,0.7);
    }
我的表单ID为
ticket

这是在表单上显示背景,但是文本输入、文本区域和选择输入并显示背景的“顶部”

如何使背景显示在所有元素之上?

试试这个

    #ticket{
    display: block;
    width: 200px;
    height: 100px;
    background: green;  
    position: relative;
}

#ticket:before {
    position: absolute;
    display: block;
    background:rgba(139,137,137,0.7);
    content: "";
    top:0;
    left:0;
    right: 0;
    bottom: 0;
    z-index:9999;
 }

如果我理解正确,您希望将输入元素放置在表单上,并且仍然能够看到表单的背景色吗

#ticket input,
#ticket textarea,
#ticket select {
    background:transparent;
}
这将使元素的背景透明,以便您可以看到表单的背景

#票证{
背景:rgba(139,137,137,0.7);
}
#票证输入,
#售票区,
#选票{
背景:透明;
}

性别
男性
女性

为什么背景会显示在任何东西之上?您可以使用pseudo(Before/After)来实现您想要的want@Paulie_D更多的是覆盖而不是背景这很好-我只是做了一些改变。请看这里:有没有办法让JQueryPopup div显示在覆盖层上?这是另一个问题…我建议提出另一个问题