在我的页面上,我有一个包含一些元素的表格,但它在Internet Explorer11中搞砸了。
下面是它在VS中的样子:

在Chrome中:

还有这里的IE:

我的代码:
<table>
<tr>
<td style="width: 50%; text-align: left"><br /><br /><br />
<asp:Label ID="lbl_dm_rvi" runat="server" Text="sometext RVI"></asp:Label><br />
<asp:Label ID="lbl_dm_odv" runat="server" Text="sometext ODV"></asp:Label>
</td>
<td style="width: 50%; text-align: right; text">
<asp:Label ID="lbl_hochrechnung" runat="server" Text="Hochrechnung_RX_SM_KVBEZ"></asp:Label><br />
<asp:Label ID="lbl_modul1" runat="server" Text="Modul 1"></asp:Label><br />
<asp:Label ID="lbl_modul_30" runat="server" Text="Modul 3.0"></asp:Label><br />
<asp:Label ID="lbl_modul_31" runat="server" Text="Modul 3.1"></asp:Label><br />
<asp:Label ID="lbl_modul3" runat="server" Text="Modul 3"></asp:Label>
</td>
</tr>
<tr>
<td colspan="2">
<img src="klammer.png" style="width: 400px"/>
</td>
</tr>
<tr>
<td colspan="2" style="text-align: center">
<asp:Label ID="lbl_modul2" runat="server" Text="Modul 2"></asp:Label><br />
<asp:Label ID="lbl_odv" runat="server" Text="ODV"></asp:Label><br />
<asp:Label ID="lbl_modul2a" runat="server" Text="Modul 2a"></asp:Label><br />
<asp:Label ID="lbl_modul4" runat="server" Text="Modul 4"></asp:Label><br />
<asp:Label ID="lbl_modul4a" runat="server" Text="Modul 4a"></asp:Label>
</td>
</tr>
</table>发布于 2016-08-08 19:56:06
我第一次看到的是IE上的表格是全宽的,其他两个不是。
这通常是因为它的浏览器对所有元素都没有相同的默认设置。
一种快速的解决方案是将表的宽度设置为
<table style="width: 300px;" >所以你没有把它随机化。
您也可以尝试使用任何"Reset CSS" (like Eric Meyer’s) ,试图将所有浏览器样式集中在一个点上。
相关:What is the easiest or fastest way to make CSS render the same in all browsers
https://stackoverflow.com/questions/38828053
复制相似问题