ElkArte Community

Project Support => Support => Topic started by: Jorin on July 14, 2016, 06:53:00 am

Title: logo on start page not centered
Post by: Jorin on July 14, 2016, 06:53:00 am
I use a start page similar to the home page here. Works great, looks great, I am happy.  :D  But my logo jumps to the right side on this page, while on all other board pages it is centered correctly. It must be a problem with my CSS code I think, but I am not good enough with this stuff to find my mistake.

Start page:
http://forum-alternative-antriebe.de

Random board page:
http://forum-alternative-antriebe.de/index.php/topic,5867.0.html

I attached the CSS and PHP file. Would be great if you could help me get my logo centered.  O:-)
Title: Re: logo on start page not centered
Post by: ahrasis on July 14, 2016, 07:05:58 am
It looks fine to me, i.e. centered correctly, on both start and forum pages.
Title: Re: logo on start page not centered
Post by: emanuele on July 14, 2016, 07:06:43 am
Same here.
Try cleaning the browser's cache.

Or maybe it's a particular browser? Which one are you using?
Title: Re: logo on start page not centered
Post by: Ruth on July 14, 2016, 07:10:00 am
It is the logobox...because she is on 40% in index.css on line 820

If you add this in your custom.css, the logo should be centered:

Code: [Select]
#logobox, .rightheader #logobox {
        max-width: 100%;
}
Title: Re: logo on start page not centered
Post by: emanuele on July 14, 2016, 07:26:26 am
Oook... that was out of my sensitivity range. lol
Sorry, it was too small of a difference for my eyes to notice...

/me is not good with layouts. lol
Title: Re: logo on start page not centered
Post by: Jorin on July 16, 2016, 01:13:43 am
Quote from: Ruth – It is the logobox...because she is on 40% in index.css on line 820

If you add this in your custom.css, the logo should be centered:

Code: [Select]
#logobox, .rightheader #logobox {
        max-width: 100%;
}

With this code it is centered on the start page, but on the forums pages it jumps to the right now.  :D
Title: Re: logo on start page not centered
Post by: Ruth on July 16, 2016, 01:23:55 am
Yes...because you have still this in index.css on line 825:

Code: [Select]
.centerheader #logobox {
    width: 100%;
}

comment it out or change it to max-width 100 % as well
Title: Re: logo on start page not centered
Post by: Jorin on July 16, 2016, 01:38:19 am
Sorry, that's not the solution.   :-[
Title: Re: logo on start page not centered
Post by: Ruth on July 16, 2016, 01:49:12 am
It is working for me...did you add this in your custom.css?

Code: [Select]
#logobox, .rightheader #logobox {
        max-width: 100%;
}


You can do both changes in index.css as well, if you dont use a custom.css:

It should look like this:

Code: [Select]
.centerheader #logobox {
    /* width: 100%; */
}
#logobox, .rightheader #logobox {
    float: right;
    padding: 0.95em 12px 0 12px;
    /*max-width: 40%;*/
    max-width: 100%;
}
Title: Re: logo on start page not centered
Post by: Jorin on July 16, 2016, 02:24:49 am
I have this in my custom.css:

Code: [Select]
#logobox, .rightheader #logobox {
    max-width: 100%;
}
.centerheader #logobox {
    max-width: 100%;
}

Logo is jumping to the right a bit on forum pages. On the start page it is perfectly centered.
Title: Re: logo on start page not centered
Post by: Ruth on July 16, 2016, 02:39:06 am
You need to change this in index.css:

Code: [Select]
.centerheader #logobox {
    width: 100%;
}

I woud do it that way:

add just this in custom.css:

Code: [Select]
#logobox, .rightheader #logobox {
        max-width: 100%;
}

and change this in index.css to:

Code: [Select]
.centerheader #logobox {
    /*width: 100%;*/
}
Title: Re: logo on start page not centered
Post by: Jorin on July 16, 2016, 02:40:55 am
But custom.css should overwrite index.css or not?
Title: Re: logo on start page not centered
Post by: Ruth on July 16, 2016, 02:46:33 am
yes...but you are not using the same in both files... ;) there is a max-width and a width.
Title: Re: logo on start page not centered
Post by: Jorin on July 16, 2016, 03:08:45 am
Okay, but then the logo isn't centered anyway on forum pages BUT I then have a small black frame showing on the right side of the screen.  ::)  :D
Title: Re: logo on start page not centered
Post by: emanuele on July 16, 2016, 03:09:31 am
General note: if you are using a custom.css there is no readon to change index.css, add this to custom.css:
Code: [Select]
.centerheader #logobox {
    width: auto;
}
instead.
Title: Re: logo on start page not centered
Post by: Jorin on July 16, 2016, 03:11:29 am
With only this it's not centered on the start page! rofl
Title: Re: logo on start page not centered
Post by: emanuele on July 16, 2016, 03:14:28 am
Then, on fixing the issue, try with:
Code: [Select]
.centerheader #logobox, .centerheader #logo, .centerheader #siteslogan,
#password_login .button_submit {
    box-sizing: initial;
}
Title: Re: logo on start page not centered
Post by: emanuele on July 16, 2016, 03:15:33 am
Quote from: Jorin – With only this it's not centered on the start page! rofl
I wrote "General note", I was just explaining how to deal with custom.css without having to touch index.css. ;)
Title: Re: logo on start page not centered
Post by: Jorin on July 16, 2016, 03:16:01 am
Great, that's working.  :)

But what about password_login button in this code? What has this to do with the logo?  :o
Title: Re: logo on start page not centered
Post by: emanuele on July 16, 2016, 03:18:09 am
It's because of the openid button cut at half the original height.
Anyway, this is not a bug, but the result of bootstrap changing the box-sizing on all the elements.

I have no idea why I thought the topic was in bugs, never mind.
Title: Re: logo on start page not centered
Post by: Jorin on July 16, 2016, 03:19:50 am
Because my other topic (http://www.elkarte.net/community/index.php?topic=3865.msg27353#new) is in bugs?  O:-)
Title: Re: logo on start page not centered
Post by: emanuele on July 16, 2016, 04:00:17 am
Possible. xD
Title: Re: logo on start page not centered
Post by: emanuele on July 16, 2016, 04:42:14 am
Sorry, that one:
#password_login .button_submit {
was:
Code: [Select]
#top_section_notice .button_submit {
Title: Re: logo on start page not centered
Post by: Jorin on July 18, 2016, 01:25:42 am
Okay, but still not centered.  ;)

Edit: I know installed Ultimate Menu and now the logo isn't centered on all pages. See:

http://www.elkarte.net/community/index.php?topic=2497.msg27384#msg27384

::)  :(

Edit: I hope only the IE has this problem. I can't check Chrome right now, but horizontal view on my mobile Chrome shows the icon centered. False alarm...
Title: Re: logo on start page not centered
Post by: emanuele on July 18, 2016, 06:15:51 pm
I think I answered that one in another topic... okay , time to go sleep, really. xD