five of nothing wrote:
Hi, I'm working on a page and my HTML validator whines when I try to
put a <div></div> or a <table></table> inside of an <a></a> tag. What
are the rules as far as what can go in there?
The spec is there for you to check.
http://www.w3.org/TR/html401/struct/links.html#edef-A
The important part is the DTD which states:
<!ELEMENT A - - (%inline;)* -(A) -- anchor -->
That means that the content of the A element can be anything defined as
%inline except for another A element.
%inline is defined as
<!ENTITY % inline "#PCDATA | %fontstyle; | %phrase; | %special; |
%formctrl;">
and the various components expand as
<!ENTITY % fontstyle "TT | I | B | BIG | SMALL">
<!ENTITY % phrase "EM | STRONG | DFN | CODE | SAMP | KBD | VAR | CITE |
ABBR | ACRONYM" >
<!ENTITY % special "A | IMG | OBJECT | BR | SCRIPT | MAP | Q | SUB |
SUP | SPAN | BDO">
<!ENTITY % formctrl "INPUT | SELECT | TEXTAREA | LABEL | BUTTON">
So that tells you all the elements that can be contained within an A
element.
Steve