• Hey!
    I want to be able to add css to text blocks in wordpress. When I’m adding a Paragraph block it only gets paragraph tags <p> </p>. Every other block gets a unique div with a class so I can style it.

    Lets say that I want to add a max-width to all text but not to covers etc. How do I do that? I understand that I can solve it with “Additional CSS Class” but that doesn’t feel right.

    So, I want to be able to set all text (including paragraphs and headings) at a max-width but I want all other blocks, as video and covers etc to be 100% width.

    Thanks for the help.

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    You can define the default style for all post p tags with a selector like .content p, the .content part would be a theme dependent class for overall post content divs. Then style other blocks with selectors like .is-type-video. As needed to override the default p style, you can add custom CSS to individual blocks under the “Advanced” block meta in the right sidebar.

    There’s really only three ways to add CSS if you haven’t built your own theme. One is the Additional CSS panel in the customizer. Another is to create a child theme with its own style.css file. Plugins can add CSS by using the wp_enqueue_style() function.

Viewing 1 replies (of 1 total)
  • The topic ‘Define Paragraph blocks’ is closed to new replies.