Can we place <img>
inside <h1>
according to web standards? like this
<h1> Demo text <img src="anyimage.jpg"/> </h1>
Yes, you can - the DTD says:
<!ELEMENT h1 %Inline;>
<!ENTITY % Inline "(#PCDATA | %inline; | %misc.inline;)*">
<!ENTITY % inline "a | %special; | %fontstyle; | %phrase; | %inline.forms;">
<!ENTITY % special "%special.pre; | object | img ">
That basically means h1
can contain %Inline
, which is made of various things, including img