Where do I write my CSS styles?

  • Unknown's avatar

    I’m using the following code to create text boxes in my blog:

    <div style="border:2px solid #b20000;padding:5px;border-radius:15px;margin-bottom:30px;text-align:justify;">

    But I’m writing all of this for all my boxes. How do I define a reusable style box so I can write in every post:

    <div style="my-box">

    ?

    I’m using WordPress as a service.

    Thank you,

    Leonardo

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    Hello Leonardo,
    You are currently using inline CSS, so re-using is not possible doing that.

    What you need to do is write a custom CSS class like this:

    .my-box {
        border: 2px solid #b20000;
        padding: 5px;
        border-radius: 15px;
        margin-bottom: 30px;
        text-align: justify;
    }

    And then reuse this class like this:

    <div style="my-box">
    <div style="my-box">
    <div style="my-box">

    NOTE: Adding custom CSS classes is currently only available with the paid WordPress.COM Premium and Business plans.

    More information about this can be found here: https://en.support.wordpress.com/custom-design/editing-css/

    Hope this helps 🙂

  • The topic ‘Where do I write my CSS styles?’ is closed to new replies.