CSS : change color of font in widgets. Stuck in the middle of my first real wordpress website

wordpress

#1

Hi everyone,

I finally got my kick in the pants to fully subscribe to CodeAcademy, and seriously learn. The reason why is that I am creating my first pro website for a partner, and I want to use CSS code to change some details of my theme : Himalaya. I found solutions to many of my challenges so it developed my perseverance … But now, I really can’t find the reason why this doesn’t work, and I find no one to tell me. So I post my problem here, hoping that someone will be kind and just answer!

Okay, so here is the challenge I face today. The homepage of the site is created of pre-coded blocks consisting of widgets (services, about, text, etc.). Normally, I should just have to paste a series of code lines in “appearance” to change the colour of the font. This is what I made and it doesn’t show any change, except for the Text widget. So why does it work for the text and not for the other widgets?

.widget_about_block {
color : #ffffff;
font-weight: normal;
font-size: 14pt;
padding-bottom: 9px;
}

.widget_service_block {
color: #ffffff;
font-weight: normal;
font-size: 14pt;
padding-bottom: 9px;
}

.widget_text {
color: #ffffff;
font-weight: normal;
font-size: 14pt;
padding-bottom: 9px;

Thank you for your patience and yesss, I’ll start leaning code properly step by step with CodeAcademy now that I’ve experimented the loneliness of the beginner …


#2

Best approach is to define your own custom style sheet and have it load last (but before any JS). Leave the default style sheet as it comes out of the box and keep a backup of your custom styles. That way if you ever update or swap out the template, you won’t lose your custom styles.

When writing custom style rules, be sure to dig up the selectors in the default styles and overwrite all properties you wish to customize, using the exact same selectors.

Loading your CSS last in the sequence will ensure that your rules are at the bottom of the cascade (greater in importance).


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.