I'm trying to validate my page. I'm suing:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
I have a few errors that I have no idea how to fix. Here it is:
there is no attribute "target":
<a href="http://mywebsite.com/" target="_blank">www.mywebsite.com</a>
end tag for element "br" which is not open:
text text text text text text text text</br>
there is no attribute "align":
<img align="top" src="imgs/image.jpg" width="45" height="38" alt=""/>
(1) Because the target attribute should only be used in frames, where it targets a specific frame. HTML should not tell a browser how to display data, only define it. And it's telling the browser to display the link in a new window. That's not the purpose of HTML, thus for that and other reasons, it's not a part of the XHTML 1.0 specification, except for XHTML 1.0 FRAMESET. I've tested that in IE and Firefox, so unless I screwed up, it should work.
(2) The vertical-align attribute can be used, but only works for table cells, as it should. The image should normally go to the top, what do you have that wouldn't? If you are (incorrectly) using tables for layout, you can put style="vertical-align:top;" I believe for the cell. The align attribute, once again, is telling a browser not about the data, but how to display it. Thus, it isn't part of the HTML 4.01 Strict nor XHTML 1.0 Strict, nor XHTML 1.1 If, however, you are using a more accessible and semantic design, there is probably an easy way to achieve what you want.
Originally posted by weee It's cool now but my problem is that I have a lot of link in the page (100 or so) so I need to go through each one of'em?
You can use JavaScript to step through some or all of the links and add the handler as desired. Post a link and tell us which links you want to abuse.
“The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
—Tim Berners-Lee, W3C Director and inventor of the World Wide Web
Bookmarks