[Resolved] Custom CSS for Table of Contents not working

Home Forums Support [Resolved] Custom CSS for Table of Contents not working

Home Forums Support Custom CSS for Table of Contents not working

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2008732
    Rachel

    Hi there,
    I have added some custom css to add underline and bold to my links within articles. Unfortunately this is also making my table of contents entries bold.

    I am trying to exclude the table of contents from this css, as I don’t want the TOC entries to be bold, but I can’t work out how to exclude the TOC. This is what I have added:

    .single-post .entry-content a:not(.toc_list) {
    text-decoration: underline;
    font-weight: bold;
    }

    Can you help advise what I need to exclude?

    Thanks,
    Rachel

    #2008750
    Elvin
    Staff
    Customer Support

    Hi Rachel,

    Try this CSS:

    .single-post .entry-content > *:not(div#toc_container) a {
    text-decoration: underline;
    font-weight: bold;
    }
    #2009130
    Rachel

    Hi Elvin,
    Thank you that worked! I wouldn’t have been able to stumble across that in a million years, so thanks so much for your help.

    Cheers,
    Rachel

    #2013860
    Elvin
    Staff
    Customer Support

    Yeah, CSS gets a bit tricky when there’s “conditions” involved because it isn’t exactly a programming language.

    Glad you got it sorted. No problem. 😀

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.