Search

3/25/2009

HTML: Using the target attribute in a strict DTD?

HTML: Using the target attribute in a strict DTD?

The only thing you need to do is adjust your Document Type Definition:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd" [ <!ATTLIST a target CDATA #IMPLIED> ]>

Or for XHTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" [ <!ATTLIST a target CDATA #IMPLIED> ]>

Of course, you could also just use a Transitional DTD.

The target attribute can be used on:

* a
* link
* area
* form

So if you want to use those elements a well, this means you should add the next lines to the definition:

* <!ATTLIST a target CDATA #IMPLIED>
* <!ATTLIST link target CDATA #IMPLIED>
* <!ATTLIST area target CDATA #IMPLIED>
* <!ATTLIST form target CDATA #IMPLIED>

沒有留言: