Is it possible to place `<img>` inside `<h1>` according to web standards?
Is it possible to place <img> inside <h1> according to web standards? like this
<h1> Demo text <img src="anyimage.jpg"/> </h1> +45
Jitendra Vyas Oct 22 '09 at 6:56 2009-10-22 06:56
source share4 answers
Yes you can - DTD :
<!ELEMENT h1 %Inline;> <!ENTITY % Inline "(#PCDATA | %inline; | %misc.inline;)*"> <!ENTITY % inline "a | %special; | %fontstyle; | %phrase; | %inline.forms;"> <!ENTITY % special "%special.pre; | object | img "> This basically means that h1 can contain %Inline , which consists of various things, including img
+69
Greg Oct 22 '09 at 6:59 2009-10-22 06:59
source shareSee who uses it: http://www.w3.org/
<h1 class="logo"><a tabindex="2" accesskey="1" href="/"><img src="/2008/site/images/logo-w3c-mobile-lg" width="90" height="53" alt="W3C" /></a> <span class="alt-logo">W3C</span></h1> +31
Max 22 Oct '09 at 7:20 2009-10-22 07:20
source shareYes, it is allowed. But don't forget to set the alt attribute to img !
+13
igor Oct 22 '09 at 6:58 2009-10-22 06:58
source shareYes and no.
You can put the image inside the h1 element, but not quite so ... the alt attribute is required.
+1
Quentin Oct 22 '09 at 6:58 2009-10-22 06:58
source share