开发者

Showing background image in IE8

My background images aren't showing in IE8:

<tr>
    <td height="11"></td>
    <td height="11"></td>
    <td height="11" background="images/lgin-bg-blnk.jpg">kjsdfk</td>
</tr>
开发者_开发知识库


background is not a valid attribute for a <td> element. Try changing it to an inline CSS style:

<td height=11 style="background:url('images/lgin-bg-blnk.jpg')">...</td>


<td height="11" background="images/lgin-bg-blnk.jpg">kjsdfk</td>

presuming from the title you want a background image it should be in a style attribute like below, or even better in an external stylesheet..

<td height="11" style="background: url(images/lgin-bg-blnk.jpg);">kjsdfk</td>


background is not a valid HTML attribute for a TD, though it was a non-standard property that was supported by older Netscape and IE browsers see: TH/TD definition

  • id, class (document-wide identifiers)
  • lang (language information),
  • dir (text direction)
  • title (element title)
  • style (inline style information )
  • onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup (intrinsic events )
  • bgcolor (background color)
  • align, char, charoff, valign (cell alignment)

Added: reference for quotes/no quotes : W3C


You must specify the width also.

<td height="11" width="" style="background: url(images/lgin-bg-blnk.jpg);">kjsdfk</td>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜