Skip to content

Changing H2 color

Solved WordPress
5 2 1.8k 1
  • wrote on last edited by phenomlab
    #1

    Hi sudonix,
    On our website, we have a class as shown in example:

    <div class="bs-blog-post list-blog">
    <article class="small col text-xs">
    <h2 class="title"><a href="https://sopriza.com/eating-live-monkey-brain-meals/">Eating live monkey brain meals</a></h2>
    

    We’re looking to change the color for h2 headings in bs-blog-post list-blog without affecting the h2 on widgets. What css should we use?

    Blog list can be found on frontpage.

  • Hi sudonix,
    On our website, we have a class as shown in example:

    <div class="bs-blog-post list-blog">
    <article class="small col text-xs">
    <h2 class="title"><a href="https://sopriza.com/eating-live-monkey-brain-meals/">Eating live monkey brain meals</a></h2>
    

    We’re looking to change the color for h2 headings in bs-blog-post list-blog without affecting the h2 on widgets. What css should we use?

    Blog list can be found on frontpage.

    wrote on last edited by phenomlab
    #5

    @Sala Just checked your site. This should work

    .bs-blog-post .title, .bs-blog-post .title a {
        color: #ffffff;
    }
    

    It’s worth noting the existing CSS, which uses variables like the below

    color: var(--head-color);
    

    These come under the :root section as below

    :root {
        --head-color: #212121;
        --stext-color: #000;
        --text-color: #718096;
        --wtext-color: #fff;
        --bg-color: #fff;
        --box-color: #fff;
        --border-color: #e2e8f0;
        --wrap-color: #eff2f7;
    }
    

    You can easily override these by using the CSS I provided at the top of this post, or you can change the underlying colours defined in the variables. However, taking this route may mean other objects are styled in the same way, which may not be the desired result.

  • Hi sudonix,
    On our website, we have a class as shown in example:

    <div class="bs-blog-post list-blog">
    <article class="small col text-xs">
    <h2 class="title"><a href="https://sopriza.com/eating-live-monkey-brain-meals/">Eating live monkey brain meals</a></h2>
    

    We’re looking to change the color for h2 headings in bs-blog-post list-blog without affecting the h2 on widgets. What css should we use?

    Blog list can be found on frontpage.

    wrote on last edited by phenomlab
    #2

    @Sala you could probably use

    .bs-blog-post h2
    
  • @Sala you could probably use

    .bs-blog-post h2
    
    wrote on last edited by phenomlab
    #3

    @phenomlab i tried to use

    .bs-blog-post h2 {
    color: #fff;
    }
    

    But not yet taking effect. Could i be missing something?

  • @phenomlab i tried to use

    .bs-blog-post h2 {
    color: #fff;
    }
    

    But not yet taking effect. Could i be missing something?

    wrote on last edited by
    #4

    @Sala said in Changing H2 color:

    .bs-blog-post h2 {
    color: #fff;
    }

    Try

    .bs-blog-post h2 {
    color: #fff !important;
    }
    
  • Hi sudonix,
    On our website, we have a class as shown in example:

    <div class="bs-blog-post list-blog">
    <article class="small col text-xs">
    <h2 class="title"><a href="https://sopriza.com/eating-live-monkey-brain-meals/">Eating live monkey brain meals</a></h2>
    

    We’re looking to change the color for h2 headings in bs-blog-post list-blog without affecting the h2 on widgets. What css should we use?

    Blog list can be found on frontpage.

    wrote on last edited by phenomlab
    #5

    @Sala Just checked your site. This should work

    .bs-blog-post .title, .bs-blog-post .title a {
        color: #ffffff;
    }
    

    It’s worth noting the existing CSS, which uses variables like the below

    color: var(--head-color);
    

    These come under the :root section as below

    :root {
        --head-color: #212121;
        --stext-color: #000;
        --text-color: #718096;
        --wtext-color: #fff;
        --bg-color: #fff;
        --box-color: #fff;
        --border-color: #e2e8f0;
        --wrap-color: #eff2f7;
    }
    

    You can easily override these by using the CSS I provided at the top of this post, or you can change the underlying colours defined in the variables. However, taking this route may mean other objects are styled in the same way, which may not be the desired result.


Did this solution help you?
Did you find the suggested solution useful? Support 💗 Sudonix with a coffee ☕
If your organisation needs deeper expertise around infrastructure, security, or technology leadership, learn more about Phenomlab Ltd. Many of the deeper technical guides behind Sudonix are published there.

Related Topics
  • configure ghost and wordpress combo

    Moved Solved WordPress ghost wordpress nginx
    9
    7 Votes
    9 Posts
    3k Views
    phenomlab
    @Madchatthew I’d always post for the reasons I stated above. It’s useful information and could save someone else the headache.
  • Hidden border

    Solved WordPress style
    17
    1 Votes
    17 Posts
    4k Views
    phenomlab
    @Sala yes please.
  • Widget | CSS customization

    Solved WordPress css
    53
    17 Votes
    53 Posts
    19k Views
    phenomlab
    @Sala the only way you can achieve this is to use a robots.txt file and disallow access to those links.
  • Fixing YouTube videos css

    Solved WordPress css
    8
    2 Votes
    8 Posts
    3k Views
    Sala
    @phenomlab It looks good, but not anymore. I’ve already lost so much time. Now it’s time to move on
  • Viewing Permission.

    Solved General support customisation
    33
    12 Votes
    33 Posts
    11k Views
    Sampo2910
    @phenomlab Ah Mark you are a star. Thank you very much. I just logged on and seen someone had worked their magic Again it is very much appreciated.
  • Embed - What Are You Using?

    Solved General customisation plugin
    13
    3 Votes
    13 Posts
    4k Views
    phenomlab
    @DownPW Hmm - it’ll work with iFramely (locally hosted), or you can use the below string to embed using https://community.nodebb.org/topic/7135/nodebb-plugin-ns-embed-ns-embed/114 Watch (?:<a.*?)?(?:https?:\/\/)?(?:www\.)?dailymotion\.com\/video\/([a-zA-Z0-9_-]{4,11})(?:.*?\/a>)? Replace <div class='embed-wrapper'><div class='embed-container'><iframe src='//www.dailymotion.com/embed/video/$1' frameborder='0' allowfullscreen></iframe></div></div> [image: 4f5f13f7-0c73-460e-b32f-f974f170b236-image.png]
  • Bottom footer navbar button extend

    Solved Customisation css javascript customisation footer navbar
    32
    9 Votes
    32 Posts
    15k Views
    phenomlab
    @DownPW said in Bottom footer navbar button extend: Oh my god, it’s beautiful mark I liked this design so much, I’ve implemented it here. I intend to do a lot more with the footer in due course, so hiding it makes a lot of sense. Thanks @DownPW for the idea and initial concept
  • move out from flarum to wordpress

    WordPress wordpress flarum migration
    87
    52 Votes
    87 Posts
    45k Views
    phenomlab
    @Hari Glad to see this went so well, and that you’ve finally departed the Flarum ecosystem