View Full Version : not sure how to validate this code...

01-01-2010, 04:17 AM
required attribute "alt" not specified
/news.png" height="16" width="222" /><div style="width: 226px; height: 155px;

The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.

Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.

<div style="width: 225px; float: left; height: 16px; background-color: #000000; color: #FFFFFF; margin-left: 0px; margin-bottom: 0px; font-size: small; padding-left: 0px;">
&nbsp;<img src="images/news.png" height="16" width="222" /><div style="width: 226px; height: 155px; float: left;"><script type="text/javascript"><![CDATA[if(document.layers){document.write('<ilayer id="ns4div" width="'+swidth+'" height="'+sheight+'" bgcolor='+sbcolor+'><layer id="ns4div1" width="'+swidth+'" height="'+sheight+'" onmouseover="sspeed=0;" onmouseout="sspeed=rspeed"></layer></ilayer>')}
if(document.getElementById||document.all){document.write('<div style="position:relative;overflow:hidden;width:'+swidth+'px;height:'+sheight+'px;clip:rect(0 '+swidth+'px '+sheight+'px 0);background-color:'+sbcolor+';" onmouseover="sspeed=0" onmouseout="sspeed=rspeed"><div id="iens6div" style="position:relative;width:'+swidth+'px;"></div></div>');}]]></script>

any ideas?

01-01-2010, 04:26 AM
add a alt empty attribute:

<img alt="" rest

will be better if you use something descriptive in alt attribute but a empty value will stop the error message.

best regards

01-01-2010, 04:46 AM
required attribute "alt" not specified

You didn't put an image alt (http://www.w3schools.com/tags/att_img_alt.asp) in there.

You are also messing up the box model (http://www.w3.org/TR/CSS2/box.html). You have an inline styled div set to 226px width inside another inline styled div set at 225px width.

Why all the inline styles anyway?

01-01-2010, 04:57 AM
Why all the inline styles anyway?

I'd like to experiment more with transporting more code to an external style sheet when I have the time. I know it will be useful when I am dealing with larger sites.