[whatwg] [HTML5] A content in <img> elements for ASCII art

Nikita Popov privat at ni-po.com
Wed Nov 25 06:56:16 PST 2009


I think the idea of replacing the alt-attribute by the content of img is 
very good. An image used as an <img> needs to be content-related an 
therefore you often could place a descriptive text into it. This would 
lead us to img being only a normal HTML-element with normal content, but 
the ability of specifying an image by "src".

On the problem of implementation:
<img src="borken_url.jpg" style="white-space:pre; 
font-family:monospace"><span style="white-space:pre; 
font-family:monospace">Test
  Hallo
  World</span></img>
If the browser knows the syntax, it'll render correct, if not it'll 
render correct only in case broken_url.jpg is really broken. Otherwise 
the text would be underneath it. So you would need to position the span 
over the img.

I don't know whether it's worth the effort, but it would be a better 
syntax than alt, in my eyes.

Nikita Popov



More information about the whatwg mailing list