html - 在 IE8 中,背景出现在 Fieldset 的边界之外

标签 html asp.net css internet-explorer

我一直致力于进行 CSS hack,以使通常在 Chrome/Firefox 中运行的功能在 Internet Explorer 7 和 8 中运行。我已经解决了大部分问题,但我无法解决这个问题,我希望得到一些帮助。

这是我的登录框的正常外观:

enter image description here

这是它在 IE 8 中的样子:

enter image description here

我想让它们看起来一样,但至少要修复颜色如何越过边界。有什么想法吗?

编辑:

这是呈现登录框的 html/服务器控件:

<form>
<fieldset style="width: 20" align="center" id="login_border">
    <legend id="login_box">Login</legend>
    <asp:Login ID="Login1" runat="server" 
        TitleText="">
    </asp:Login>
</fieldset>
</form>

这是 CSS:

#login_border 
{
    Border: 0.25em black solid; 
    margin-left: 1em; 
    padding: 0.2em 0.8em;
    background-color: #fdbe12;
    position: fixed;
    top: 50%;
    left: 50%;
    margin-top: -100px;
    margin-left: -142px;
}

#login_box 
{
    Border: 0.1em black solid; 
    margin-left: 1em; 
    padding: 0.2em 0.8em;
    background-color: White;
    font-size: 1.5em;
}

.login 
{
    font-size: 1.1em;
    font-weight: bold; 
}

最佳答案

您可以尝试为图例提供负边距顶部,这将得到修复。

*margin-top:-22px;   //for IE7
margin-top:-22px\0/; //for IE8, Note `\0/` characters here.

关于html - 在 IE8 中,背景出现在 Fieldset 的边界之外,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17302910/

相关文章:

javascript - 您可以安全地将 Google 跟踪代码管理器代码放在 <head> 部分的多高位置?

c# - 从 C# 文本 block 中提取子字符串

c# - 使用 C# 的文件路径

html - Flexbox 内部的 Flexbox( slider )

html - 将 Font awesome 和文本向左对齐

html - 谷歌浏览器中的白线?

php - 发布前离线保存数据

asp.net - ASPX 文件中有数百万个不间断空格?

asp.net - Css 验证在 asp 网络中不起作用

java - iText:在 Java 中将 html 和 css 转换为 PDF