0

我编写了 5 个 dapbles 脚本,使用 div 将它们正确定位。我在 Chrome 和 IE 中检查过,不同的是,在 IE 中,文本是粗体格式,但在 chrome 中是正常的。我使用了该<span>属性,因为我<p>的一些图形设计在表格中看起来不太好,但在我使用它的其他地方看起来不错。

我的表格代码:

<dic class="elevraadet">
<table align="center">
<tr>
<td><span style="font-size:12px;"><b>Klasse</b></span></td>
<td><span style="font-size:12px;">&nbsp;</span></td>
<td><span style="font-size:12px;"><b>Namn</b></span></td>
<td><span style="font-size:12px;">&nbsp;</span></td>
<td><span style="font-size:12px;"><b>Verv</b></span></td>
</tr>
<tr>
<td><span style="font-size:12px;">3ST</span></td>
<td><span style="font-size:12px;">&nbsp;</span></td>
<td><span style="font-size:12px;">Reynaldo Galaz</span></td>
<td><span style="font-size:12px;">&nbsp;</span></td>
<td><span style="font-size:12px;">Leiar</span></td>
</tr>
<tr>
<td><span style="font-size:12px;">1ST</span></td>
<td><span style="font-size:12px;">&nbsp;</span></td>
<td><span style="font-size:12px;">Frida Vevle</span></td>
<td><span style="font-size:12px;">&nbsp;</span></td>
<td><span style="font-size:12px;">Nestleiar</span></td>
</tr>
<tr>
<td><span style="font-size:12px;">2ST</span></td>
<td><span style="font-size:12px;">&nbsp;</span></td>
<td><span style="font-size:12px;">&Oslash;yvind Hartveit</span></td>
<td><span style="font-size:12px;">&nbsp;</span></td>
<td><span style="font-size:12px;">Skrivar</span></td>
</tr>
<tr>
<td><span style="font-size:12px;">2EL</span></td>
<td><span style="font-size:12px;">&nbsp;</span></td>
<td><span style="font-size:12px;">Robin B. Myking</span></td>
<td><span style="font-size:12px;">&nbsp;</span></td>
<td><span style="font-size:12px;">Kasserar/vara for skrivar</span></td>
</tr>
<tr>
<td><span style="font-size:12px;">2BU</span></td>
<td><span style="font-size:12px;">&nbsp;</span></td>
<td><span style="font-size:12px;">Gina Nordpoll</span></td>
<td><span style="font-size:12px;">&nbsp;</span></td>
<td><span style="font-size:12px;">Styremedlem</span></td>
</tr>
<tr>
<td><span style="font-size:12px;">2IND</span></td>
<td><span style="font-size:12px;">&nbsp;</span></td>
<td><span style="font-size:12px;">Anders Skråmestø</span></td>
<td><span style="font-size:12px;">&nbsp;</span></td>
<td><span style="font-size:12px;">Styremedlem</span></td>
</tr>
<tr>
<td><span style="font-size:12px;">1EL</span></td>
<td><span style="font-size:12px;">&nbsp;</span></td>
<td><span style="font-size:12px;">Thomas K. Fotland</span></td>
<td><span style="font-size:12px;">&nbsp;</span></td>
<td><span style="font-size:12px;">Styremedlem</span></td>
</tr>
<tr>
<td><span style="font-size:12px;">1DH</span></td>
<td><span style="font-size:12px;">&nbsp;</span></td>
<td><span style="font-size:12px;">Nathalie P. Hartveit</span></td>
<td><span style="font-size:12px;">&nbsp;</span></td>
<td><span style="font-size:12px;">Styremedlem</span></td>
</tr>
<tr>
<td><span style="font-size:12px;">1HS</span></td>
<td><span style="font-size:12px;">&nbsp;</span></td>
<td><span style="font-size:12px;">Tina-Marie S. Langeland</span></td>
<td><span style="font-size:12px;">&nbsp;</span></td>
<td><span style="font-size:12px;">Styremedlem</span></td>
</tr>
<tr>
<td><span style="font-size:12px;">1TIPa</span></td>
<td><span style="font-size:12px;">&nbsp;</span></td>
<td><span style="font-size:12px;">Marcus W. Øye</span></td>
<td><span style="font-size:12px;">&nbsp;</span></td>
<td><span style="font-size:12px;">Styremedlem</span></td>
</tr>
<tr>
<td><span style="font-size:12px;">1TIPb</span></td>
<td><span style="font-size:12px;">&nbsp;</span></td>
<td><span style="font-size:12px;">Bjørn Sebastian S. Rongved</span></td>
<td><span style="font-size:12px;">&nbsp;</span></td>
<td><span style="font-size:12px;">Styremedlem</span></td>
</tr>  
</table>
</div>  

我的 CSS 代码:

.elevraadet
{
border:groove, #09F;
position:absolute;
left:30px;
}  

所以我的问题是,我该如何解决这个问题,以使其在 IE 中不会变得粗体/强?
我添加了两张截图,一张来自Chrome

一个来自IE

4

1 回答 1

1

这里有两件事要做,就是尝试解决这个问题。

首先,为跨度设置样式,最好使用 CSS 而不是内联样式。

所以把它添加到你的 CSS 文件中

.elevraadet span { font-wieght: normal; font-size: 12px; }

其次,没有调用 CSS,因为 div 标签不正确!(用 dic 代替 div)

<div class="elevraadet">
<table align="center">
<tr>
<td><span><b>Klasse</b></span></td>
<td><span>&nbsp;</span></td>
<td><span><b>Namn</b></span></td>
<td><span>&nbsp;</span></td>
<td><span><b>Verv</b></span></td>
</tr>
<tr>
<td><span>3ST</span></td>
<td><span>&nbsp;</span></td>
<td><span>Reynaldo Galaz</span></td>
<td><span>&nbsp;</span></td>
<td><span>Leiar</span></td>
</tr>
<tr>
<td><span>1ST</span></td>
<td><span>&nbsp;</span></td>
<td><span>Frida Vevle</span></td>
<td><span>&nbsp;</span></td>
<td><span>Nestleiar</span></td>
</tr>
<tr>
<td><span>2ST</span></td>
<td><span>&nbsp;</span></td>
<td><span>&Oslash;yvind Hartveit</span></td>
<td><span>&nbsp;</span></td>
<td><span>Skrivar</span></td>
</tr>
<tr>
<td><span>2EL</span></td>
<td><span>&nbsp;</span></td>
<td><span>Robin B. Myking</span></td>
<td><span>&nbsp;</span></td>
<td><span>Kasserar/vara for skrivar</span></td>
</tr>
<tr>
<td><span>2BU</span></td>
<td><span>&nbsp;</span></td>
<td><span>Gina Nordpoll</span></td>
<td><span>&nbsp;</span></td>
<td><span>Styremedlem</span></td>
</tr>
<tr>
<td><span>2IND</span></td>
<td><span>&nbsp;</span></td>
<td><span>Anders Skråmestø</span></td>
<td><span>&nbsp;</span></td>
<td><span>Styremedlem</span></td>
</tr>
<tr>
<td><span>1EL</span></td>
<td><span>&nbsp;</span></td>
<td><span>Thomas K. Fotland</span></td>
<td><span>&nbsp;</span></td>
<td><span>Styremedlem</span></td>
</tr>
<tr>
<td><span>1DH</span></td>
<td><span>&nbsp;</span></td>
<td><span>Nathalie P. Hartveit</span></td>
<td><span>&nbsp;</span></td>
<td><span>Styremedlem</span></td>
</tr>
<tr>
<td><span>1HS</span></td>
<td><span>&nbsp;</span></td>
<td><span>Tina-Marie S. Langeland</span></td>
<td><span>&nbsp;</span></td>
<td><span>Styremedlem</span></td>
</tr>
<tr>
<td><span>1TIPa</span></td>
<td><span>&nbsp;</span></td>
<td><span>Marcus W. Øye</span></td>
<td><span>&nbsp;</span></td>
<td><span>Styremedlem</span></td>
</tr>
<tr>
<td><span>1TIPb</span></td>
<td><span>&nbsp;</span></td>
<td><span>Bjørn Sebastian S. Rongved</span></td>
<td><span>&nbsp;</span></td>
<td><span>Styremedlem</span></td>
</tr>  
</table>
</div>
于 2013-04-19T09:49:09.047 回答