• How to set global fonts size in CSS ? p { font-size:14px; }

    hello,

    I found that I should add this to my Additional CSS to display all test with 14 size:

    p {
    font-size:14px;
    }

    But my theme also has a style.css file and I would like to set the fonts size in this file, but how to write it please ?

    Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello @cacabe,

    It is generally not recommended to directly change your theme files, because every time you update it, your changes will be overwritten.

    For just a few lines of CSS, like in your case, it is okay to add them in the “Additional CSS” section in the Customizer.

    In case you have many changes to make beyond just a few lines of CSS, then the recommended way is to add them to a child theme instead. You can find more information about child themes and how they work here https://www.wpbeginner.com/wp-themes/how-to-create-a-wordpress-child-theme-video.

    Hi,

    I would not recommend adding this to your theme stylesheet because you will lose the modification when an update is made available to that theme.

    The best way to add custom CSS is either via the Customizer (which it seems like you have done) or with a child theme. By using either of these methods you ensure that your change will persist after any theme updates.

    Thread Starter cacabe

    (@cacabe)

    @justinahinon Thank you, I already have a child theme and want to add the font size to
    style.css

    SO PLEASE:

    how to add
    p {
    font-size:14px;
    }

    to style.css ?

    I cannot just put these 3 lines in style.css it seems ?

    p {
    font-size:14px;
    }

    @cacabe, you can add these lines to your child theme style.css.

    There are a couple of reasons why this might not work:

    1. Your child theme style.css is not enqueued properly, meaning that it is not included in your site.

    2. There is another CSS code applied to p tags that overwrite the new one you are adding.

    Could you share a link to the concerned site/page? I might be able to help properly.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to set global fonts size in CSS ? p { font-size:14px; }’ is closed to new replies.