Apply style change to group of blocks

  • Unknown's avatar

    I would like to use a more readable/professional looking font for my terms and conditions pages (cookies, terms and privacy policy)

    I have used the HTML block to add this:

    <style>
    p.terms {
    font-family: 'Roboto Slab', serif;
    }
    ul.terms {
    font-family: 'Roboto Slab', serif;
    }
    </style>

    If I don’t use the terms bit it changes the font for everything (including my header menu which I don’t want to change).

    I can add the terms class to individual paragraphs and lists but there are a lot of them. I tried grouping them together and gave the group the terms class but then nothing changes font.

    So far I’ve tried going through the w3 schools stuff and googled a fair amount of variations of what I think my problem is but have come up blank. I’m assuming I’m being an idiot and missing something obvious.

  • Hi @tom2093e3c3452b, you should be able to target all paragraphs within an entire page of your site.

    Try viewing the page source; you’ll see a page-id-NNN in there somewhere, or post ID. Then you can use that to help you construct a selector, for example:

    .page-id-5 .entry-content p, .page-id-5 .entry-content li {
       color: red;
    }

    .. using your own CSS of course.

    If you need more help, please share a link to the affected page. Cheers :)

  • Unknown's avatar

    this works perfectly, the page ID also seems to be in the URL when I’m editing the page

    Thanks for your help!

  • The topic ‘Apply style change to group of blocks’ is closed to new replies.