Sp 108

From Htmlpedia
Jump to: navigation, search

OpenSP: There is no attribute ...

Cause:

The element uses an attribute that does not exist. This error can be caused by:

  • Using proprietary attribute of IE or Netscape
  • Incorrect choice of the document type. Deprecated attributes are not part of HTML 4.01 Strict.
  • Mistyping the attribute name

This is usually fixed by using CSS to achieve the desired effect instead.

Example:

Sample: <table> proprietary attribute "height"

Bad<table height="100%">
Good<table style="height: 100%;">
Bad<table border="2">
Good<table border="2">

Solution:

  • Check the spelling and case of the element and attribute, (Remember XHTML is all lower-case)
  • Check that they are both allowed in the chosen document type
  • Use CSS instead of this attribute.

Most attributes have a equivalents in standard HTML or CSS.

Element Proprietary Attribute Standard Attribute
<body> marginwidth=0, marginheight=0, leftmargin=0, topmargin=0 style="margin: 0"
<frameset> border=0, frameborder=0 ,framespacing=0 None with frameset. See here. Use a HTML table with iframe for the same result.
<table> height=100% style="height: 100%;"
<table> nowrap style="white-space: nowrap;"
<td> background="image.png" style="background-image: url(image.png);"

References: