News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

color

Started by nurul112, January 17, 2016, 09:02:26 AM

Previous topic - Next topic

nurul112

 8)How add color to categorie  text ?

Bigguy

Play around with index.css a bit and you should get it.

Sir Osis of Liver

/css/index.css



h3.catbg a:link, h3.catbg a:visited, h4.catbg a:link, h4.catbg a:visited, h3.catbg, .table_list tbody.header td, .table_list tbody.header td a
{
color: #fff;
}


Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Bigguy

There ya go. Thank you Sir. :)

Siirist

Quote from: Sir Osis of Liver on January 17, 2016, 09:03:44 PM
/css/index.css



h3.catbg a:link, h3.catbg a:visited, h4.catbg a:link, h4.catbg a:visited, h3.catbg, .table_list tbody.header td, .table_list tbody.header td a
{
color: #fff;
}



So this will change the color of the text on all the categories, is that correct?

If this is true, would that mean that I cannot have a different color of text on different categories?

Be Well,
Siirist
Needed information:
- What's your SMF version?, What MODs are installed? What Theme(s) are you using? Have you backed up your database?

--> At least 50% of the questions asked are answered in the Online Manual <--
Mods for ver 1.x will NOT run on ver 2.x

Kindred

just like the boards...  you can create individual CSS calls...

<tbody class="header" id="category_22">
the ID allows you to target CSS to the specific category heading
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Siirist

Quote from: Kindred on January 19, 2016, 01:29:26 PM
just like the boards...  you can create individual CSS calls...

<tbody class="header" id="category_22">
the ID allows you to target CSS to the specific category heading

Sweet!!!

Thanks Kindred!

Be Well,
Siirist

*EDIT: Well pooh, "<tbody class="header" id="category_22">" does not exist in the Themes/ostara1/css/index.css
Needed information:
- What's your SMF version?, What MODs are installed? What Theme(s) are you using? Have you backed up your database?

--> At least 50% of the questions asked are answered in the Online Manual <--
Mods for ver 1.x will NOT run on ver 2.x

Kindred

that was an example from this site...

look at your own site using the browser developer tools or firefox+firebug
check what the category_### value is for your categories...

add a line for
#category_2 (or whatever it actually is)
{
color: blue !important;
}
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Siirist

Hmm...


line# 742
/* Styles for rounded headers.
------------------------------------------------------- */
h3.catbg, h3.catbg2, h3.titlebg, h4.titlebg, h4.catbg
{
overflow: hidden;
height: 31px;
line-height: 31px;
font-size: 1.2em;
font-weight: bold;
}
h3.catbg a:link, h3.catbg a:visited, h4.catbg a:link, h4.catbg a:visited, h3.catbg, .table_list tbody.header td, .table_list tbody.header td a
{
color: #fff;
#category_2
{
color: blue !important;
}
}
h3.catbg2 a, h3.catbg2
{
color: #feb;
}
Line#764


the attached forum2/Themes/default/index.css was downloaded before the above changes

Thank you for your time.
Siirist
Needed information:
- What's your SMF version?, What MODs are installed? What Theme(s) are you using? Have you backed up your database?

--> At least 50% of the questions asked are answered in the Online Manual <--
Mods for ver 1.x will NOT run on ver 2.x

Siirist

I am not understanding.

I found
}
h3.catbg a:link, h3.catbg a:visited, h4.catbg a:link, h4.catbg a:visited, h3.catbg, .table_list tbody.header td, .table_list tbody.header td a
{
color: #fff;
#category_2
{

My Categories text is white

When I change color: #000, then every category's text is black.

I do not understand how to change the color for each individual category.

Agreed in those } { it references #category_2 yet effects all categories and I don't see a reference to each of the other categories.

I attached my Themes/default/css/index.css again.

Thanks in advance.

Be Well,
Siirist
Needed information:
- What's your SMF version?, What MODs are installed? What Theme(s) are you using? Have you backed up your database?

--> At least 50% of the questions asked are answered in the Online Manual <--
Mods for ver 1.x will NOT run on ver 2.x

Illori

so you have


/* Styles for rounded headers.
------------------------------------------------------- */
h3.catbg, h3.catbg2, h3.titlebg, h4.titlebg, h4.catbg
{
overflow: hidden;
height: 31px;
line-height: 31px;
font-size: 1.2em;
font-weight: bold;
}
h3.catbg a:link, h3.catbg a:visited, h4.catbg a:link, h4.catbg a:visited, h3.catbg, .table_list tbody.header td, .table_list tbody.header td a
{
color: #fff;
#category_2
{
color: blue !important;
}
}
h3.catbg2 a, h3.catbg2
{
color: #feb;
}



after that add

#category_2
{
color: blue !important;
}

Siirist

Hey Illori,  :) :)

Thanks for your reply.

I did that and saved it and there was no change. Category text is still white.

New code looks like this

* Styles for rounded headers.
------------------------------------------------------- */
h3.catbg, h3.catbg2, h3.titlebg, h4.titlebg, h4.catbg
{
overflow: hidden;
height: 31px;
line-height: 31px;
font-size: 1.2em;
font-weight: bold;
}
h3.catbg a:link, h3.catbg a:visited, h4.catbg a:link, h4.catbg a:visited, h3.catbg, .table_list tbody.header td, .table_list tbody.header td a
{
color: #fff;
#category_2
{
color: blue !important;
}
}
h3.catbg2 a, h3.catbg2
{
color: #feb;
}
#category_2
{
color: blue !important;
}
h3.catbg a:hover, h4.catbg a:hover, .table_list tbody.header td a:hover
{
color: #fd9;
text-decoration: none;
}
h3.catbg2 a:hover
{
color: #fff;
text-decoration: none;
}
h3.titlebg a, h3.titlebg, h4.titlebg, h4.titlebg a
{
color: #222;
}
h3.titlebg a:hover, h4.titlebg a:hover
{
color: #53616f;
text-decoration: none;
}


There are now two (2) entries of
{
color: blue !important;
}

//EDIT: I changed the forum's default theme to SMF Default Curve so that you can see the forum as a guest in the right theme.

Hmm . . .
Needed information:
- What's your SMF version?, What MODs are installed? What Theme(s) are you using? Have you backed up your database?

--> At least 50% of the questions asked are answered in the Online Manual <--
Mods for ver 1.x will NOT run on ver 2.x

Illori

you did not add the code as you said, you have it with in other css definations. you need to put it AFTER the closing } bracket.

Siirist

Um, here's what I understand and see.

{ = open bracket
} = closing bracket

color: #fff;
   #category_2
{ (open)
color: blue !important;
} (close)
} (close) [this is a double close, hmmm . . .
h3.catbg2 a, h3.catbg2
{ (open)
   color: #feb;
} (close)
#category_2
{ (open)
color: blue !important;
} (close)

Is this like a $125.00 fix in Paid?
Needed information:
- What's your SMF version?, What MODs are installed? What Theme(s) are you using? Have you backed up your database?

--> At least 50% of the questions asked are answered in the Online Manual <--
Mods for ver 1.x will NOT run on ver 2.x

Illori

you have this

h3.catbg a:link, h3.catbg a:visited, h4.catbg a:link, h4.catbg a:visited, h3.catbg, .table_list tbody.header td, .table_list tbody.header td a
{
color: #fff;
#category_2
{
color: blue !important;
}


it should be this

h3.catbg a:link, h3.catbg a:visited, h4.catbg a:link, h4.catbg a:visited, h3.catbg, .table_list tbody.header td, .table_list tbody.header td a
{
color: #fff;
}
#category_2
{
color: blue !important;
}


do you see the difference?

Sir Osis of Liver



h3.catbg a:link, h3.catbg a:visited, h4.catbg a:link, h4.catbg a:visited, h3.catbg, .table_list tbody.header td, .table_list tbody.header td a
{
color: #fff;
#category_2
{
color: blue !important;
}
}



Should be -



h3.catbg a:link, h3.catbg a:visited, h4.catbg a:link, h4.catbg a:visited, h3.catbg, .table_list tbody.header td, .table_list tbody.header td a
{
color: #fff;
}
#category_2
{
color: blue !important;
}



Ninja'd.  :P
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Siirist

Quote from: Illori on January 28, 2016, 03:52:03 PM
you have this

h3.catbg a:link, h3.catbg a:visited, h4.catbg a:link, h4.catbg a:visited, h3.catbg, .table_list tbody.header td, .table_list tbody.header td a
{
color: #fff;
#category_2
{
color: blue !important;
}


it should be this

h3.catbg a:link, h3.catbg a:visited, h4.catbg a:link, h4.catbg a:visited, h3.catbg, .table_list tbody.header td, .table_list tbody.header td a
{
color: #fff;
}
#category_2
{
color: blue !important;
}


do you see the difference?

Yes. Thank you. *scratches head* Interesting positioning of the switches.

Quote from: Sir Osis of Liver on January 28, 2016, 03:59:03 PM

color: blue !important;
}
}



Should be -


color: blue !important;
}



Ninja'd.  :P


Nice spotting Sir Osis
Got that taken care of too (I deleted the second close switch, as shown below).

Thank you both.

Now I have

h3.catbg a:link, h3.catbg a:visited, h4.catbg a:link, h4.catbg a:visited, h3.catbg, .table_list tbody.header td, .table_list tbody.header td a
{
color: #fff;
}
#category_2
{
color: blue !important;
}
h3.catbg2 a, h3.catbg2
{
color: #feb;
}
#category_2
}
h3.catbg a:hover, h4.catbg a:hover, .table_list tbody.header td a:hover

(which I uploaded)

I have looked at the forum (SMF Default Curve) and the categories remain white on a light blue background.

*sighs*
Needed information:
- What's your SMF version?, What MODs are installed? What Theme(s) are you using? Have you backed up your database?

--> At least 50% of the questions asked are answered in the Online Manual <--
Mods for ver 1.x will NOT run on ver 2.x

Illori

use your browsers developers tools to inspect the category header and find out the correct id for it. each header has its own id/number.

Siirist

Quote from: Illori on January 28, 2016, 06:39:53 PM
use your browsers developers tools to inspect the category header and find out the correct id for it. each header has its own id/number.

I remember this from years ago using SMF ver 1.0  :-\

You guys aren't going to believe what I remembered.   O:)

I can use HTML codes ie. <font color="#0000FF">blah blah blah</font>   ;D

Sorry for all the trouble.  ???

Cordially,
Siirsit
Needed information:
- What's your SMF version?, What MODs are installed? What Theme(s) are you using? Have you backed up your database?

--> At least 50% of the questions asked are answered in the Online Manual <--
Mods for ver 1.x will NOT run on ver 2.x

Illori

but you should NOT. we told you the correct way to do the task you wanted.

Advertisement: