Dropzone: Center document preview in dropzone element

Created on 29 Mar 2017  路  1Comment  路  Source: dropzone/dropzone

Dear all,

First of all I want to say thanks to the people behind Dropzone, this is an awesome project.
I am wondering if, in the case of a MaxFiles: 1 usage of Dropzones, it was an option/way to center the unique image preview.
By default, it seems like uploads are aligning to left of the element and I cannot find any way to change that.

Any input highly appreciated!

Most helpful comment

I know that its been a year since the question was asked, but the solution I found might be helpful for future reference.

You just need to add the text-align: center CSS property to any ancestor of the image preview.
The image preview is indeed an inline-block, and inline-blocks behave like text.

In my case I just added this in my CSS file:
.dropzone { text-align: center; }

>All comments

I know that its been a year since the question was asked, but the solution I found might be helpful for future reference.

You just need to add the text-align: center CSS property to any ancestor of the image preview.
The image preview is indeed an inline-block, and inline-blocks behave like text.

In my case I just added this in my CSS file:
.dropzone { text-align: center; }

Was this page helpful?
0 / 5 - 0 ratings

Related issues

knifesk picture knifesk  路  17Comments

claudiorivetti picture claudiorivetti  路  25Comments

pedrocunha picture pedrocunha  路  18Comments

KateMort picture KateMort  路  22Comments

mschipperheyn picture mschipperheyn  路  98Comments