Javascript div的背景不会改变透明度

Javascript div的背景不会改变透明度,javascript,jquery,html,css,asp.net,Javascript,Jquery,Html,Css,Asp.net,我有一个div“flooter\u EditData\u Panel\u popup”,其中包含updatepanel、占位符和更多div 我想增加外部div“flotter\u EditData\u Panel\u popup”的透明度,让用户只看到一点点背景 到目前为止,div的背景色仍为白色,而文本框则褪色 .floaterDiv{ top: 0%; left: 0%; height: 450px; width: 800px; border: solid 1px

我有一个div“flooter\u EditData\u Panel\u popup”,其中包含updatepanel、占位符和更多div

我想增加外部div“flotter\u EditData\u Panel\u popup”的透明度,让用户只看到一点点背景

到目前为止,div的背景色仍为白色,而文本框则褪色

.floaterDiv{
  top: 0%;
  left: 0%;
  height: 450px;  
  width: 800px; 
  border: solid 1px blue; 
  /*background-color:white;*/
  background-color:rgba(255,0,0,0.5);
  margin:1; 
  text-align:left; 
  outline-style: none;
  display:none;
  overflow:hidden;
  zoom: 1;
  filter: alpha(opacity=40);
  opacity: 0.4;
  z-index:999999999999;
  /* background-blend-mode: multiply;*/
}



<div id="floater_EditData_Panel_popup" title="Feature Information" class="floaterDiv"> 
    <p1>Select a feature to view/edit feature information.</p1>
   <br />
   <br />
   <br />
      <asp:UpdatePanel runat="server" id="UpdatePanelDetails1" updatemode="Conditional" Childrenastriggers="true">
        <ContentTemplate>
          <asp:PlaceHolder ID="PlaceHolder1" runat="server" >
          </asp:PlaceHolder>
          <br />
          <br />
          <div id="EditDataPanelMessageOutput" style="color:Red;">

         </div>
          <div id="FeatureMeasureOutput"></div>
          <br />
          <br />
          <div class="buttonwrap">
            <div id="Span2" class="ActionBtns" style="display: inline-block;" >
              <asp:button runat="server" id="UpdateButton" value="Save" Text="Save" OnClientClick="ValidateEditData();" CausesValidation="true" ValidationGroup="g_currentSelectedLayerName" />
            </div>
          </div>
          <asp:ValidationSummary runat="server" ID="valSummary1" HeaderText="You must enter a value in the following fields:" DisplayMode="BulletList" EnableClientScript="true" ShowSummary="true" Enabled="true" />

        </ContentTemplate>

      </asp:UpdatePanel>
    </div>
这将产生以下结果:

请告知

  top: 0%;
  left: 0%;
  height: 450px;  
  width: 800px; 
  border: solid 1px blue; 
  background-color:rgba(255,255,255,0.5) !important;
  /* overrule other css statements */
  margin:1; 
  text-align:left; 
  outline-style: none;
  display:none;
  overflow:hidden;
  zoom: 1;
  z-index:999999999999;
如果这不起作用,您应该检查另一个CSS语句是否正在将背景颜色更改为白色或FFF。检查铬合金并检查元素的样式

尝试移除

filter: alpha(opacity=40);
opacity: 0.4;
这会影响DIV的内容,而不是背景本身

还应将RGBA值更改为

rgba(255,255,255,0.3);

对于白色半透明背景

首先,避免使用不透明度。最好改用rgba背景色。其次,可能还有另一个包装器元素,它的周围有一个白色的背景色。如果有,请删除其背景色。尝试将背景色更改为黑色而不是白色背景色:rgba0,0,0.5@HashemQolami感谢回复iv尝试了rgba,但没有效果。@Benjamin感谢回复changin BK底色改为黑色没有效果diff@John还要检查包装是否有背景色。它看起来像jQuery UI,如果是这样的话,如果你能提供一个在线示例,那会很有帮助。对不起,我忘了从文本中删除它,已经从代码中删除了它,但没有区别。ID你也删除了所有不透明的东西?添加!重要的是要否决其他回复声明。有另一个包裹在沙发上,但很高兴知道!重要的