will show up an image with text "200x200" and will show up an image with text "200x200" and will show up an image with text "200x200" and

holderjs show text and size at the same time

342 Views Asked by At

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.

2

There are 2 best solutions below

1
Har devgun On

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>
1
imsky On

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.