Please or Register to create posts and topics.

Need some help with colors

Hi,

I’m having some trouble trying to change the background color for each forum category. See image showing the CSS.

I was able to change the category font pretty easily using the first 3 lines. Lines 4-6 are my attempt at changing the background color.

Cleared the cache several times and no luck, so I’m guessing there’s some error with the code. Any help would be greatly appreciated.

Uploaded files:
  • Code.PNG

Hey @thetradition,

usually your CSS should work, but I would change it to the following lines:

#forum-category-XX {
   color: red !important;
   background-color: blue !important;
}

Do you also tried different browsers? For CSS problems Firefox is a good tool to find a bug.

If you share your URL I can also have a look.

If you ever wonder how to return the favour for helping you.

@qualmy91

I tried your suggested lines and no luck.

I used Firefox Inspector, and it looks like maybe the color change is being overwritten by the source CSS. See below.

What would be the smartest way to fix this? I tried using the plug in editor, but it kept reverting back to the old code after I made changes.

Uploaded files:
  • Code_source.PNG

Hey @thetradition,

to overwrite your custom color you have to add #af-wrapper to your CSS:

#af-wrapper #forum-category-XX {
   color: red !important;
   background-color: blue !important;
}

Then it should work.

thetradition has reacted to this post.
thetradition
If you ever wonder how to return the favour for helping you.

@qualmy91

Thanks, that worked perfect.

Is there any way I can change the colors of the bars once inside a topic? See attached. I’m talking about the black bars at the top of the first post and reply.

EDIT: Note I want to do this without changing the main color in settings

Uploaded files:
  • Bar2.PNG
  • Bar1.PNG

Hey @thetradition,

please try the following CSS:

#af-wrapper #forum-editor-form .title-element {
    background-color: red;
}

It should only change the title of the editor. Please try also different browsers, for compatibility. You may have to add !important if it doesn’t work in other browsers.

thetradition has reacted to this post.
thetradition
If you ever wonder how to return the favour for helping you.

@qualmy91

Thanks. Is there any way I can change the color of the editor to where it’s different for each forum category?

@thetradition

That’s quite tricky, because you cant get the category id just with CSS. If you want to do this you will probably have to edit the source code to add this information to the page.

If you ever wonder how to return the favour for helping you.

@qualmy91

What would be the easiest way to do that? This is the last color change I need to make

@thetradition

The easiest way would probably be to add a class to the body tag. You can check here how it was implemented.

Then you have to find a way when it should add the forum category and add it to the body tag.

Asgaros has reacted to this post.
Asgaros
If you ever wonder how to return the favour for helping you.