Search…

X3 Photo Gallery Support Forums

Search…
 
tbp
Experienced
Topic Author
Posts: 42
Joined: 12 Apr 2020, 09:19

Index Page: Place Logo in center

16 Apr 2020, 10:15

Hi,

another question: Is there a way to place the logo (jpeg/png) in the middle (horizontal and vertical) of the frontpage (index page) only?
I want my logo right in the center of the photo on the index page, but on all other pages it should be on its standard position.

Thanks
Thomas
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Index Page: Place Logo in center

16 Apr 2020, 23:57

Yes, but this is not built-in functionality, as it's too abstract.

Almost anything is possible with custom CSS though. Try this simple fix:
Code
.page-index .logo {
  margin-top: calc(50vh - 108px);
}
We use "page-index" to assign the style only to the index page. Every page has a body class "page-{folder-path}", so that CSS styles can be assigned on a per-page basis. Then we just add 50 vh (viewport height) margin, minus half the height of the logo, so that it's centered.