Category Archives: Drupal

Drupal Image Oddity

In working on porting a hand coded web site to a Drupal web site there are a number of pages that need to be ported to the “Drupal way” of doing things.  One strange item that I ran across was was this image of what Drupal rendered for an image.  Admittedly, the src URL wasn’t correct.  What was unexpected was that instead of showing a placeholder the src and alt attributes were showing.
Drupal Image Oddity
Drupal Image Oddity

Typically when I setup a page with images I like to use a style like:

      <img class="badge"
           src="images/badges/npp.logo.80x15.png"
           alt="Notepad++" />

Using multiple lines makes it easier to see all that is happening with the image.

Apparently this confuses Drupal in some way.  Drupal would not render the placeholder for the image until all of the attributes for the <img> tag were placed on the same line.

      <img class="badge" src="images/badges/npp.logo.80x15.png" alt="Notepad++" />