How to fix w3.org validation error: There is no attribute “sid” or, Element “iframe” undefined?
-
14-06-2021 - |
Question
i am trying to validate someone else's code here and they are using the xhtml1-strict DOCTYPE.
i am almost there; except for few erors...
- There is no attribute "sid"
- Element "iframe" undefined
For the SID attribute issue, this is what they have:
<li class="drop" sid="nav_products"> <span class="head">Our Products</span>
<ul id="nav_products" style="display: none;">
<li><a href="/products/itemNumOne.php">Toys</a></li>
<li><a href="/products/itemNumTwo.php">Tools</a></li>
<li><a href="/products/itemNumThree.php">Beauty</a></li>
<li><a href="/products/itemNumFour.php">Electronics</a></li>
</ul>
</li>
And because of the IFRAME error, i am also getting 2 more errors:
- there is no attribute "src"
there is no attribute "style"
<h2>Read The Latest News</h2> <iframe src="http://p.p0.com/YesConnect/HtmlMessagePreview?a=TiTnp" style="width:100%; height:4350px; border-collapse:collapse; border:1px solid #ccc; padding:10px 0 0"></iframe>
Can anyone PLEASE help me fix these errors? I am not an expert in this area, so you will have to explain a bit the solutions. Thanks a lot in advance for your time and help!!!
Solution
The question to ask is probably why the previous developer was using "sid" in the first place. As far as I know, attribute "sid" will never validate in any XHTML doctype, so it's a good idea to change it to "class" or "id", and then change the code that relies on "sid" accordingly.
OTHER TIPS
Okay, so I was googling for solutions and found this site that kind of answered my questions on iframe
So I ended up changing the DOCTYPE for that one page to "XHTML 1.0 Transitional" from "XHTML 1.0 Strict" and that fixed all 3 errors I was getting for using iframe. Hope this info helps someone :)
however, i am still stuck with the error for sid, any help will be greatly appreciated!
UPDATE: This answer is almost 6 yrs old, and looks like since then few things have changed :P As Davide Andrea had pointed out, the above link doesn't work anymore, some of you might find this answer helpful: https://stackoverflow.com/a/8265544/1081016