Simple Machines Community Forum

SMF Support => SMF 2.1.x Support => Topic started by: camefromwpandmybb on September 22, 2021, 04:15:46 PM

Title: How to center the logo in SMF 2.1 RC 3
Post by: camefromwpandmybb on September 22, 2021, 04:15:46 PM
I found a thread but that was for 2.0 RC3 and the coding is different.  Help?

Basically I don't need the site slogan, so I left that empty but where the site slogan space is, it pushes the header logo to the left and leaves huge amount of blank space on the right.
Title: Re: How to center the logo in SMF 2.1 RC 3
Post by: Antechinus on September 22, 2021, 04:23:15 PM
Add this to the end of index.css. :)
#siteslogan, img#smflogo {
    display: none;
}
h1.forumtitle {
    text-align: center;
}
Title: Re: How to center the logo in SMF 2.1 RC 3
Post by: camefromwpandmybb on September 22, 2021, 04:26:13 PM
No workie :(

The mobile view of the default theme, still shows to the left, i think maybe the coding for the site slogan needs to be removed?
Title: Re: How to center the logo in SMF 2.1 RC 3
Post by: Antechinus on September 22, 2021, 04:30:54 PM
Ok, hang on while I check responsive.css too.
Title: Re: How to center the logo in SMF 2.1 RC 3
Post by: Antechinus on September 22, 2021, 04:48:45 PM
Ok, find this in responsive.css:
h1.forumtitle a, h1.forumtitle {
    padding: 5px 0 0 4px;
    max-width: 300px;
    margin: 10px 0;
}

Change it to this:
h1.forumtitle a, h1.forumtitle {
    padding: 5px 0 0;
}
Title: Re: How to center the logo in SMF 2.1 RC 3
Post by: camefromwpandmybb on September 23, 2021, 04:40:44 PM
That didn't change anything :(
Title: Re: How to center the logo in SMF 2.1 RC 3
Post by: Antechinus on September 23, 2021, 04:52:48 PM
I tested it live. It works. Try hard refreshing your browser. If necessary, clear the cache too.
Title: Re: How to center the logo in SMF 2.1 RC 3
Post by: camefromwpandmybb on September 23, 2021, 04:56:12 PM
here it is the screen shots
Title: Re: How to center the logo in SMF 2.1 RC 3
Post by: camefromwpandmybb on September 23, 2021, 05:04:01 PM
here are screen shots, desktop is fine, mobile notta

desktopview.png

mobile view.png
Title: Re: How to center the logo in SMF 2.1 RC 3
Post by: Antechinus on September 23, 2021, 05:12:49 PM
How are you getting that image as well as the forum name?
Title: Re: How to center the logo in SMF 2.1 RC 3
Post by: camefromwpandmybb on September 23, 2021, 05:19:18 PM
Quote from: Antechinus on September 23, 2021, 05:12:49 PMHow are you getting that image as well as the forum name?

I think I know what you are asking?  So the desktop image, you can see the spacing is equal left and right sides.  The mobile, I just resized my browser to show the mobile mode.  I also looked at it on 2 phones and the same thing, pushed to the left. as the forum name?  do not understand that part of the question
Title: Re: How to center the logo in SMF 2.1 RC 3
Post by: camefromwpandmybb on September 23, 2021, 05:21:33 PM
Quote from: Antechinus on September 23, 2021, 05:12:49 PMHow are you getting that image as well as the forum name?

Oh now I understand, the forum name I blocked out.  That is not text, it's text i converted to lineart as an image.
Title: Re: How to center the logo in SMF 2.1 RC 3
Post by: Antechinus on September 23, 2021, 05:24:42 PM
Ok, the problem is this in responsive.css:
    #header {
        margin-left: 0;
        margin-right: 0;
    }

Header width is set to 90% in index.css, which should have been overidden in responsive.css if the left and right margins were going to be removed (may be an RC4 bug - will check).

Solutions:
1/ Set #header width to auto:
#header {
    width: auto;
    margin-left: 0;
    margin-right: 0;
}
or...
2/ Set the margins back to what they originally were in index.css:
#header {
    margin: 0 auto;
}
Either of those should work.
Title: Re: How to center the logo in SMF 2.1 RC 3
Post by: camefromwpandmybb on September 23, 2021, 06:09:42 PM
I did the first one, not the second one, it worked.  which do you suggest to use?

thank you for your valuable time in this.
Title: Re: How to center the logo in SMF 2.1 RC 3
Post by: Antechinus on September 23, 2021, 07:46:29 PM
It doesn't really matter which one you use. They both do much the same thing. :)
Title: Re: How to center the logo in SMF 2.1 RC 3
Post by: camefromwpandmybb on September 23, 2021, 07:48:27 PM
Quote from: Antechinus on September 23, 2021, 07:46:29 PMIt doesn't really matter which one you use. They both do much the same thing. :)

Ok I thought with coders there is a way of doing things like less code, efficient coding.  proper syntax, etc.  you know how they say don't jumble all your coding together like a run on sentence, make it neat, legible, etc.  haha, you da man/woman (not sure what gender). thanks.
Title: Re: How to center the logo in SMF 2.1 RC 3
Post by: Antechinus on September 24, 2021, 04:05:06 PM
Technically the second option is marginally more efficient, but it's not something you will ever notice when using the site. :)