XF 1.5 Text in center of Header

NavyRet

Member
Licensed customer
I would like to be able to insert text in the middle of the header between the two logos (one on each side). Any help will be greatly appreciated. Thanks.


LOGO
I would like to insert various text messages here with the ability to change it when I want to. Thanks.​
LOGO
 
This would be one approach:

Edit ad_header template
Code:
<div class="header-text">
    This is a slogan
</div>
<div class="header-right">
    <img src="https://dummyimage.com/100x90/000/fff.png" />
</div>

Add this to extra.less:

Code:
#header .pageWidth .pageContent
{
    position: relative;
    text-align: center;
}
.header-text
{
    position: absolute;
    margin: 0 auto;
    left: 0;
    right: 0;
}
.header-right
{
    position: absolute;
    right: 0;
}
@media (max-width:610px)
{
    .header-text, .header-right { display: none; }
}

It'd hide the elements in mobile.
 
Thanks, but all that did was place the text over the left logo. I think what you put might be for XF 2.x, not 1.5.22.

My code is for 1.5.x, not the 2.x series.

Definitely works on mine, you may have a custom style that's preventing this. If you do have you tried contacting your style author for assistance?

Screenshot_12.webp
 
Nope, puts it over the left logo in the default style. Also, I do not have an "extra.less". I have an extra.css. That's why I thought it was for 2.x
 
I know it's been a while, but I would still like to do this. I just don't know where to start or how to even search for it. Any help would be appreciated and please make sure it's for 1.5.x. Thanks.
 
Just add to the .header-text:

Code:
.header-text
{
    position: absolute;
    margin: 0 auto;
    left: 0;
    right: 0;
top: 30px; 
}


Adjust the 30px.
 
I'm sorry, but I don't understand. Where would that conditional statement go in relation to this?

Code:
<div class="header-text">
    This is a slogan
</div>
<div class="header-right">
    <img src="https://dummyimage.com/100x90/000/fff.png" />
</div>
 
Back
Top Bottom