XF 2.3 Logo problem

Abraham54

Well-known member
Licensed customer
I made a Christmas style.

But I have a problem with the logo.
I searched all templates for logo, but found nothing that the problem could solve.

In extra.less I have this:

Code:
.p-header-logo {
    vertical-align: middle;
    margin-left: auto;
}

Kerstmisthema.webp

This theme is based on the default style; the logo should nicely in the center of the picture, but it stays on the right, it is a puzzle!

How to solve this problem?
 
I made a Christmas style.

But I have a problem with the logo.
I searched all templates for logo, but found nothing that the problem could solve.

In extra.less I have this:

Code:
.p-header-logo {
    vertical-align: middle;
    margin-left: auto;
}

View attachment 351056

This theme is based on the default style; the logo should nicely in the center of the picture, but it stays on the right, it is a puzzle!

How to solve this problem?
Hi Abraham54,

extra.less doesn't replace the default rules, it adds to them. In the default style, .p-header-content is a flex row (justify-content: space-between) and .p-header-logo already has margin-right: auto. Auto margins in that row are fragile: anything else sitting there (an ad in the container_header position, an add-on, another rule in your style) changes where the free space goes.

The reliable way is to center the row itself and reset the logo margins. Replace your rule with this:

CSS:
.p-header-content
{
    justify-content: center;
}

.p-header-logo
{
    margin-left: 0;
    margin-right: 0;
}

If the logo still doesn't move after that, the CSS isn't the problem. Right-click the "Merry Christmas" text and choose Inspect:

  • If you land on the header background instead of an <img> inside .p-header-logo, the text is part of the background picture itself. You'd need to re-export the picture with the text in the middle, or save the text as a separate transparent PNG and set it as your logo.
  • If the <img> is highlighted but its outline is much wider than the visible text, the PNG has empty transparent space on its left side. Crop it in your image editor.

Nice header by the way, the reindeer look great! :D
 
Back
Top Bottom