Forums / Templates, Stylesheets, Page Layout / Center the Header Logo on V1.3.7

Center the Header Logo on V1.3.7

Views: 8,117

Results 1 to 20 of 24
28 Feb 2007, 10:42 PM
#1
mike1969 avatar

mike1969

New Zenner

Join Date:
Feb 2007
Posts:
27
Plugin Contributions:
0

Center the Header Logo on V1.3.7

Hi,
I'm trying to centralise the header logo in Zencart v1.3.7, I've tried following instructions from previous posts but nothing seems to work.
At the moment my line in my template stylesheet reads as follows
#logo {float: left; position: absolute; top: 15px; left: 15px;}
I've tried changing it to #logo {text-align: center; margin: 0 auto;} but it still aligns to the left.
Any help would be great,
Thanks

2 Mar 2007, 7:16 PM
#2
grandmaj avatar

grandmaj

Zen Follower

Join Date:
Feb 2007
Posts:
104
Plugin Contributions:
0

Re: Center the Header Logo on V1.3.7

Have you tried:

#logo {margin-left: auto; margin-right: auto; }

It worked some of the areas I was editing.

2 Mar 2007, 8:49 PM
#3
mike1969 avatar

mike1969

New Zenner

Join Date:
Feb 2007
Posts:
27
Plugin Contributions:
0

Re: Center the Header Logo on V1.3.7

Hi GrandmaJ,
Thanks for your reply, I've just tried it and I'm afraid it's still stuck on the left hand side! I'm wondering now if there is some code somewhere else that is instructing it to be positioned to the left. :bored:
Cheers,
Mike

3 Mar 2007, 4:24 AM
#4
grandmaj avatar

grandmaj

Zen Follower

Join Date:
Feb 2007
Posts:
104
Plugin Contributions:
0

Re: Center the Header Logo on V1.3.7

Hmm.. . can you post the url?

3 Mar 2007, 10:15 AM
#5
mike1969 avatar

mike1969

New Zenner

Join Date:
Feb 2007
Posts:
27
Plugin Contributions:
0

Re: Center the Header Logo on V1.3.7

Hi,
My url is www.lathespares.co.uk I've even tried to alter the code to try and make the logo appear on the right instead of the left and it still appears on the left!
Cheers,
Mike

3 Mar 2007, 12:19 PM
#6
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Center the Header Logo on V1.3.7

Try making the following changes to your stylesheet.css

#headerBackground {text-align:center;width: 100%; height: 83px; background: url(../images/bg_header.jpg) repeat-x #88a0c2;}

#logo {margin:0;}

make the changes highlighted in red

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

3 Mar 2007, 12:52 PM
#7
mike1969 avatar

mike1969

New Zenner

Join Date:
Feb 2007
Posts:
27
Plugin Contributions:
0

Re: Center the Header Logo on V1.3.7

Hi Clyde,

That's brilliant, it worked first time! :yes: I've also added to the {margin:0;} this bit of extra code to centralise it in the up and down axis {margin: 1% 0;} I don't know if this is the correct way or not to centralise it up and down but if it's not please let me know.

Thanks again,

Mike

3 Mar 2007, 1:00 PM
#8
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Center the Header Logo on V1.3.7

Glad to help.

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

24 Jun 2007, 4:37 AM
#9
classact avatar

classact

Zen Follower

Join Date:
Apr 2006
Location:
Right Here
Posts:
106
Plugin Contributions:
0

Re: Center the Header Logo on V1.3.7

Hello

can anyone help me please.......I am trying to put my banner in but not sure where it goes the path that is and I got this error when doing it.......

Warning: Cannot modify header information - headers already sent by (output started at /home/doggil/public_html/cart/includes/languages/english/classic/header.php:41) in /home/doggil/public_html/cart/includes/init_includes/init_templates.php on line 78

when this happened it made everything really really big......does anyone know how to fix this....

God bless
ClassAct :oops:

11 Aug 2007, 4:08 AM
#10
debi avatar

debi

New Zenner

Join Date:
Aug 2007
Posts:
7
Plugin Contributions:
0

Re: Center the Header Logo on V1.3.7

I had that same problem, and finally realized that I had accidentally created a space after the final php on that page. Delete those spaces, and refresh your browser. Worked for me.

25 Jan 2011, 1:26 AM
#11
davidrayandj avatar

davidrayandj

New Zenner

Join Date:
Jan 2011
Posts:
48
Plugin Contributions:
0

Re: Center the Header Logo on V1.3.7

clydejones:

Try making the following changes to your stylesheet.css

#headerBackground {text-align:center;width: 100%; height: 83px; background: url(../images/bg_header.jpg) repeat-x #88a0c2;}

#logo {margin:0;}

make the changes highlighted in red

help...I can't find this piece of code. Is this the same thing as the logo-wrapper? Please oh please can I have a detailed map on how to get there...(newbie here :lookaroun)...

I have been trying to get this darn logo centered to the middle of the page and everything I have come across in the forums (and elsewhere when I google) does not seem to make any difference to the darn thing...It has planted itself firmly to the left.

It's personal now...lol

25 Jan 2011, 7:41 AM
#12
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Center the Header Logo on V1.3.7

#headerBackground is a custom id that existed only on that template. The stock template has #headerWrapper, #logoWrapper and #logo, among others; we need to see your site live to know for sure what your template has to style.

25 Jan 2011, 2:32 PM
#13
davidrayandj avatar

davidrayandj

New Zenner

Join Date:
Jan 2011
Posts:
48
Plugin Contributions:
0

Re: Center the Header Logo on V1.3.7

Gotcha...

Not live yet at this point so unless I stumble upon it in the meantime (which is how I end up finding most answers anyway) I will put it on the back burner and keep on plugging along...

Thanks for the reply!:smile:

25 Jan 2011, 5:08 PM
#14
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Center the Header Logo on V1.3.7

You need to install Firefox and its Web Developer and Firebug extensions. They are some of the main tools we use to answer such questions, and you can use them for yourself.

25 Jan 2011, 11:05 PM
#15
davidrayandj avatar

davidrayandj

New Zenner

Join Date:
Jan 2011
Posts:
48
Plugin Contributions:
0

Re: Center the Header Logo on V1.3.7

Thanks!

26 Jan 2011, 11:43 AM
#16
oredayo avatar

oredayo

New Zenner

Join Date:
Oct 2010
Posts:
61
Plugin Contributions:
0

Re: Center the Header Logo on V1.3.7

Hello,
I tried to center my main top image (French_and_Provence_tablecloths_Provence_Decoration.jpg) after looking for on internet and reading this post but can't find
this part:
#logo {
text-align:center;
}

Where can I find this? Should I insert it somewhere? But how to do it right?

Thanks for any help.
p r o v e n c e d e c o r a t i o n . c o m

26 Jan 2011, 2:01 PM
#17
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Center the Header Logo on V1.3.7

If there is not already a #logo { rule in your stylesheet, you can add one and put whatever properties you want in it.
It would logically go just after the #logoWrapper { rule if there is one of those.

26 Jan 2011, 2:18 PM
#18
oredayo avatar

oredayo

New Zenner

Join Date:
Oct 2010
Posts:
61
Plugin Contributions:
0

Re: Center the Header Logo on V1.3.7

Gjh42 you saved me one more time!
THX.

Still no way to have a logo that could suit to 100% of the screens instead of being with a fixed width?

26 Jan 2011, 2:46 PM
#19
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Center the Header Logo on V1.3.7

If you have the logo as an <img> in #logo, you can style it to stretch to 100% of page width... though that will usually look rather strange. The best solution if you want a logo/header to fill a fluid width page is to use the "sliding doors" method - google for it. You can use #headerWrapper, #logoWrapper and #logo as containers for this.

28 Jan 2011, 1:38 PM
#20
davidrayandj avatar

davidrayandj

New Zenner

Join Date:
Jan 2011
Posts:
48
Plugin Contributions:
0

Re: Center the Header Logo on V1.3.7

Ok I finally got my logo to move to the center (well almost)

Here is what I did:

/includes/templates/simply_kerrin/css/ directory.

Look for this code:#logo, .centerBoxContents, .specialsListBoxContents, .categoryListBoxContents, .centerBoxContentsAlsoPurch, .attribImg {
float: left;
}

remove #logo: so that it now reads:
.centerBoxContents, .specialsListBoxContents, .categoryListBoxContents, .centerBoxContentsAlsoPurch, .attribImg {
float: left;
}

Then add this code after the above code:

#logo {
text-align: center;
}

#logoWrapper {
margin: 0 auto;
}

And it moves....! Yea
BUT...it is not completely centered in the middle. It is a little off to the left and could be better.

Is there something else I could add to move it just a little more to the right?