Can we place <img>
inside <h1>
according to web standards? like this
<h1> Demo text <img src="anyimage.jpg"/> </h1>
<img>: The Image Embed element. The <img> HTML element embeds an image into the document.
The <img> tag is used to embed an image in an HTML page. Images are not technically inserted into a web page; images are linked to web pages. The <img> tag creates a holding space for the referenced image.
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
Look who is using 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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With