2

I use holderjs to generate a placeholder image for my site.

<img data-src="holder.js/200x200" /> will show up an image with text "200x200" and <img data-src="holder.js/200x200?text=hello" can display the image with text "hello".

Is there any way to show up the image size and custom text together(don't set the text as something like "200x200 hello")??

Thanks~

Update: 06/25/2015

Git the response from the developer of dustjs as below

If you need to be sure that whitespace is left between two elements (for example, inline-block elements or inside white-space: pre blocks, you can use the Dust special {~s} to insert a space. You can also leave trailing whitespace at the end of a line if your editor allows it. Dust will not strip trailing whitespace.

Carl
  • 21
  • 2

2 Answers2

0

try this:

    <img  data-src="holder.js/200x200?text=hello&fg=#FF0000&size=50" alt='Thumbnail' class="big"/>

It will show size within text and color


update 1:

put image tag in div tag with class "holderjs"

<div class="holderjs" data-background-src="?holder.js/300x200">
<img  data-src="holder.js/300x200/?text=hello" alt='Thumbnail' class="img-thumbnail img-responsive" text="hello" />

</div>
Har devgun
  • 533
  • 6
  • 25
  • Thanks, but it doesn't work. Attribute `size` just resize the font-size while `fg` changes the color. – Carl Jun 24 '15 at 08:24
0

While this is not currently possible to do, there is an issue to Holder to implement this in 2.9: https://github.com/imsky/holder/issues/148

Edit: this is now implemented.

imsky
  • 3,239
  • 17
  • 16