Html CSS在所有浏览器中工作,但在IE中不工作
我有一个简单的登录页面,我在其中应用了一些css代码,如下所示:Html CSS在所有浏览器中工作,但在IE中不工作,html,css,Html,Css,我有一个简单的登录页面,我在其中应用了一些css代码,如下所示: div.loginheader { width: 100%; height: 25%; position: relative; text-align: center; margin: 0 auto; top: 6%; left: 6%; } img.center { display: block
div.loginheader {
width: 100%;
height: 25%;
position: relative;
text-align: center;
margin: 0 auto;
top: 6%;
left: 6%;
}
img.center {
display: block;
padding: 0px;
}
td.caption
{
margin-left: auto;
margin-right: auto;
text-align: center;
font-family: Arial,Georgia,Serif;
color: #ffffff;
font-size:24px;
}
使用以下HTML代码:
<div class="loginheader">
<table width="90%">
<tr>
<td width="20%" class="caption">
<img class="center" src="abc.png">
</td>
<td width="80%" class="caption">
Test Text
</td>
</tr>
</table>
</div>
测试文本
但使用上述代码,它在除IE之外的所有brwoser中都能完美工作。在IE中,位置和边距都在破坏。我的网页看起来像这样
在IE7中
任何帮助都将不胜感激
在IE中,头寸和利润率正在下降
闻起来很像IE正在运行,导致了IE6/7的出现。确保在HTML页面顶部声明/使用了正确的doctype
<!DOCTYPE html>
另见:
td.center
类,但是在标记中,只有class=“center”
元素。这是故意的吗?你说什么工作完美?你能给我们发一个在ff和ie中的截图吗?你能详细说明什么东西在ie中不起作用吗?我还建议您提供上下文,因为完全按照发布的方式运行代码不会提供任何信息。请尝试在运行时使用IE developer工具栏设计页面,然后比较其他浏览器中的更改,我同意你的看法,即IE在%中使用宽度时会有一些不同的外观。请尝试在右栏中减去1%