Forums / Templates, Stylesheets, Page Layout / Changing Category font size

Changing Category font size

Views: 8,810

Results 1 to 19 of 19
28 Apr 2009, 10:01 PM
#1
neogeo202 avatar

neogeo202

New Zenner

Join Date:
Mar 2009
Posts:
9
Plugin Contributions:
0

Changing Category font size

Alot of people keep asking this, and alot of people keep giving out complex answers to a simple fix. Overcoding an easy fix just provides more room for problems. Its like my programming teacher used to say Keep it simple. Simplicity is key when making changes to code and writing new code. It Allows the code to run smoothly and execute properly.

If you are looking to change the color of your categories fonts or even the size it is simply fixed through your stylesheet.css
found in:
/includes/templates/your_template/css

Your stylesheet.css is part of the major framework to your site and zencart. If you are looking to make changes on a global change to the site always refer to your stylesheet.css

simply open up the css folder and find your stylesheet.css file and open it up with and editor such as notepad.

scroll down the sheet towards the bottom till you come to this line

/* categories box parent and child categories */

under this you will also see the following code.

<Code ----
A.category-top, A.category-top:visited {
color: #1217FB;
text-decoration: none;
}
A.category-links, A.category-links:visited {
color: #004080;
text-decoration: none;
}
A.category-subs, A.category-products, A.category-subs:visited, A.category-products:visited {
color: #000000;
text-decoration: none;
}
---- Code>

Note: When you look at the code you will see their is no declarations of font size, there for a default font size is chosen.

To fix this issue you need to add this code:

font-size: 1.2em;

adjust the numbers to your liking to fit your template style or look.

Once you have added the statement to the code it should look like this.

A.category-top, A.category-top:visited {
color: #1217FB;
text-decoration: none;
font-size: 1.2em; <--------------------
}

Once done backup the original and put it in a safe place then save the new file with the same name stylesheet.css

then overwrite the old file in the file server.

once completed return to your site and press F5 to refresh the page and to see your changes.

Unlike other peoples approaches to fix this issue this addresses it the way it should and the real right way to address the issue. Note: to everyone editing their zencart and customizing it. Always refer to your stylesheet.css when trying to make a global change to your site. Your stylesheet.css is your framework to the site and therefor will contain code that will effect your site with global changes.

I hope this helps you out.
:clap::clap::clap:

16 Sep 2009, 11:01 PM
#2
kuhgar avatar

kuhgar

New Zenner

Join Date:
Sep 2009
Posts:
1
Plugin Contributions:
0

Re: Changing Category font size

Thanks for the info. I'd like to know how to change the sub category font color and the sub sub category font color in the left hand box as well. My list will go down multiple tiers so this is a way to keep it organized. My site is at http://www.newwayinvest.com/catalog. So far I've kind of got it, but not really, I suck at CSS.

6 Oct 2009, 9:15 PM
#3
neogeo202 avatar

neogeo202

New Zenner

Join Date:
Mar 2009
Posts:
9
Plugin Contributions:
0

Re: Changing Category font size

i just takes time and practice. Once you mess with it for a while it becomes sencond nature. And easier as you go on to make changes quickly to your site.

21 Oct 2009, 7:15 AM
#4
monsterness avatar

monsterness

New Zenner

Join Date:
Oct 2009
Location:
Dutch,
Posts:
25
Plugin Contributions:
0

Re: Changing Category font size

Cheers,!

It's nice that people take the time to explain such things,
Makes it easier for me to understand the css !
:clap:

Suddenly I saw it,

I zenned.

17 May 2011, 11:37 PM
#5
dimsumgurl avatar

dimsumgurl

Zen Follower

Join Date:
Dec 2009
Location:
Canada
Posts:
160
Plugin Contributions:
0

Re: Changing Category font size

Hello,

I followed your tips and got it to partially work... The colour reflects however the font size doesn't... could you shed some light?

A.category-top {color: #1217FB;text-decoration: none;font-size: 3em;}

thelittlestgiftboutique.com/teststore/

Thanks =]

18 May 2011, 4:01 AM
#6
gjh42 avatar

gjh42

Black Belt

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

Re: Changing Category font size

Your stylesheet_betterCategoriesEZInfo.css is loaded after stylesheet.css (so takes precedence where there is a conflict), and has rules that affect the same elements by different names.

28 Jun 2011, 9:07 PM
#7
hound avatar

hound

New Zenner

Join Date:
Jan 2007
Posts:
59
Plugin Contributions:
0

Re: Changing Category font size

Thanks for the easy explanation of the font size but how about the actual font itself? What if I want to use something else? Is that in the stylesheet? Also what if I want to bold the font?

Thanks!:cool:

29 Jun 2011, 1:52 AM
#8
gjh42 avatar

gjh42

Black Belt

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

Re: Changing Category font size

Same basic answer... add a declaration to the appropriate rule for the property you want to change.

A.category-top, A.category-top:visited {
color: #1217FB;
font-family: verdana, arial, sans-serif; /* font1st_choice, font2nd_choice, fallback; */
font-weight: bold;

text-decoration: none;
font-size: 1.2em;
}

20 Jul 2011, 8:34 PM
#9
carl avatar

carl

New Zenner

Join Date:
Dec 2006
Location:
France
Posts:
62
Plugin Contributions:
0

Re: Changing Category font size

"/* categories box parent and child categories */"

I would love to try this , but it does not exist in my stylesheet. using Glacial Age Template Design by Clyde Jones

20 Jul 2011, 10:31 PM
#10
gjh42 avatar

gjh42

Black Belt

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

Re: Changing Category font size

Just add rules to your stylesheet if there is not already one for the element selector you want to change.
A link to see your site live will let us give accurate advice.

21 Jul 2011, 11:52 AM
#12
carl avatar

carl

New Zenner

Join Date:
Dec 2006
Location:
France
Posts:
62
Plugin Contributions:
0

Re: Changing Category font size

I did it , Just added the code to bottom of page like you said AND magic so easy, so good. THANKS.

30 Nov 2011, 5:04 PM
#13
neogeo202 avatar

neogeo202

New Zenner

Join Date:
Mar 2009
Posts:
9
Plugin Contributions:
0

Re: Changing Category font size

If you are using a template that you have bought either from template monsters or even another company your stylesheets may be spread over several css files. So with that being sead if you need to find where a particular css variable or item on your website is handled.

Download the web developer add on in mozilla firefox. Then there is an option to where you can highlight the particular item you want to change and it will give you a hint of the coded commands and rules that handle that item.

Its quick and easy and will help you to understand css a little quicker on what handles what in css.

But keep in mind any tutorial i post up may differ if you are using a different template. If you are using the stock zencart template then it will matchup to my tutorial. But custom templates however will no match up the same but the principal is still there.

30 Nov 2011, 5:10 PM
#14
neogeo202 avatar

neogeo202

New Zenner

Join Date:
Mar 2009
Posts:
9
Plugin Contributions:
0

Re: Changing Category font size

Hound:

Thanks for the easy explanation of the font size but how about the actual font itself? What if I want to use something else? Is that in the stylesheet? Also what if I want to bold the font?

Thanks!:cool:

Yes you can change font via the stylesheet. However if you have multiple stylesheet and have a seperate declaration on another style sheet that loads after the main it will take precedence over the original declaration.

The best thing to do is test it and find out. If you only have 1 or 2 style sheets then you should be good. For people like me who have 10 to 15 style sheets it gets crazy.

here is a little quick idea on how to change the font.

CSS Font Change Variable:

p{
font-family:"Times New Roman", Times, serif;
}

22 Feb 2012, 4:15 AM
#15
perkiekat avatar

perkiekat

Zen Follower

Join Date:
Aug 2009
Location:
Carmi, IL
Posts:
354
Plugin Contributions:
0

Re: Changing Category font size

ok. Thanks for the info. I got a question. I need to make the font larger in the main category links. Image attached. Not sure what code I am after. Right now it is connected to the body font but I do not want to change the body font, just the header categories.

Attachment #10174

Thank you.

Zen Cart user all the way for online stores!

22 Feb 2012, 1:22 PM
#18
perkiekat avatar

perkiekat

Zen Follower

Join Date:
Aug 2009
Location:
Carmi, IL
Posts:
354
Plugin Contributions:
0

Re: Changing Category font size

gjh42:

Add to your stylesheet

.categoryListBoxContents a {font-size: 1.3em;}

Thank you so very much for the help!! Have a great day!! Worked like a charm!!

Zen Cart user all the way for online stores!

29 Feb 2012, 6:49 PM
#19
one_tall_man avatar

one_tall_man

Zen Follower

Join Date:
Feb 2009
Posts:
125
Plugin Contributions:
0

Re: Changing Category font size

I have a question about the categories under the main logo: it looks like they sometimes miss spaces.
Not sure what am I doing wrong. Have a look: http://www.vintageelectronics.ca/index.php?main_page=

My install: was Vanilla 1.3.9h, now 1.5.5b, Apache 2.4, PHP 7.0.6, MySQL 5.5.8 64b, Windows 7 64b, 8GB RAM, i3 3.3gHz
Modules: [Payment=Paypal] [Shipping=Canada Post 1.5.3 merged] [nonCAPTCHA]