Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XHTML - What elements are allowed within the <a> element?

I know span strong and em. Are there any others? I'm trying to filter a text which goes inside a link, and need to know what elements should I leave unfiltered?

like image 564
Alex Avatar asked Nov 10 '10 22:11

Alex


People also ask

What is allowed inside an a tag?

It's OK to put block elements inside an <a> tag The spec says : The a element may be wrapped around entire paragraphs, lists, tables, and so forth, even entire sections, so long as there is no interactive content within (e.g. buttons or other links).

What are the important elements of an XHTML document?

An XHTML document must have an XHTML DOCTYPE declaration. A complete list of all the XHTML Doctypes is found in our HTML Tags Reference. The <html>, <head>, <title>, and <body> elements must also be present, and the xmlns attribute in <html>, must specify the xml namespace for the document.


1 Answers

According to the DTD, lots of elements:

br | span | bdo | map
object | img | tt | i | b | big | small 
ins | del | script | input | select | textarea | label | button
em | strong | dfn | code | q |
               samp | kbd | var | cite | abbr | acronym | sub | sup 
like image 101
Ned Batchelder Avatar answered Sep 23 '22 01:09

Ned Batchelder