编辑:更改标题实际上是正确的
我正在尝试在所有 HTML 和 CSS 中模拟一个模式弹出窗口,并且我正在做的一个单一元素有点运气不好。我希望最里面的 div,即包含内容的 div,不像边框那样不透明,但无论我用 CSS 尝试什么,我都无法让它工作。这是代码:
CSS
.modalBackground {
background-color:Gray;
filter:alpha(opacity=70);
opacity:0.7;
}
的HTML
<table style="height: 100%; width: 100%; position: fixed; top: 0; left: 0;"><tr><td class="modalBackground">
<div style="display: table; height: 40px; width: 150px; position: fixed; overflow: hidden;
top: 40%; margin-top: -50px; left: 50%; margin-left: -75px; padding-left: 30px;
border: solid 1px navy; background-color: White;">
<div style="#position: absolute; #top: 50%; display: table-cell; vertical-align: middle;">
<div style="#position: relative; #top: -50%;"
><asp:Image runat="server" ImageUrl= "~/images/indicators/indicatordark.gif" /> working...</div>
</div>
</div></td></tr></table>
我在这方面已经走到了尽头。无论如何,我都不是 HTML 或 CSS 专家,因此非常感谢您解释为什么该解决方案有效。