Welcome to the in5 Answer Exchange! This a place to get answers about in5 (InDesign to HTML5) and make requests.
0 votes

my company has the same problem that since i use in5 in Indesign CC my content ist aligned left.

That's a real problem for us cause we are in an stable working process and need the centerd aligment for our layouts. We cannot insert javascript, even when it would work, every time when we export the content. That's not an solution for our User.

What can we de to fix this in a way where nobody has to use some script code?

Best regards

related to an answer for: Center page in web browser
in how_to by (220 points)
edited by
You don't have to insert JavaScript each time you export...you attach in the Resources section and it's automatically attached each time you export (with no extra effort).

Do you want to *scale* or *center*?

Those are two different things. :-)
Hi Justin,

i want to center my content.
But i need to attach the resources for each document or?
The document is automatically centered horizontally in most cases. Do you want to center it vertically as well?
Hi Justin, no just horizontally. I've got my documents with html output for download: https://ftp.premedia.at/_yeCiIBh9sVOByR

in this case the first page isn't centerd. do you know why?

best regards
Hi Justin, i would be very thankful if you could response to me pretty early cause i would need the answer for a customer project.

thx in advance
Thanks for the file, Manuel. See the answer for a fix. :-)

1 Answer

0 votes
Best answer

In this case, you are using the 1) Continuous Scroll (Vertical) page format and 2) you have varying page sizes.

The combination of these two items causes the smaller pages to be left-aligned.

The following CSS will horizontally center all pages:

.paper-vertical .page {
   float: none !important;
   margin: 4px auto !important;

Alternatively, you can use one of the Slider formats and it will automatically center, even with varying page sizes.

by (197k points)
selected by
Thx Justin! Is there a way to insert the css permanently so that i don't have to append it to each different document?
You could modify the base CSS in the installation directory:
[InDesign Application Directory]/Scripts/in5_v2/firstrun/html5_output/assets/css/pages.css

This will only be overwritten when you reinstall or update in5.