[Resolved] CSS and ID

Tagged: 

  • Author
    Posts
  • #5546

    Andrew Misplon
    Keymaster

    Hi Nube

    If you add a class name there must be no period, for example:

    my-class-name

    You can then target that class in your child stylesheet or Custom CSS plugin:

    .my-class-name {
    color: red;
    }

    If you use the CSS Styles field you must only write declarations (property and value) with no ;. For example:

    color: red
    font-size: 20px

    It’s easier to use class names and there will be a wider application. Using your browser’s code inspector is very important in the process, especially if your rules don’t take effect.

    Hope this helps.

    #5547

    Nube
    Participant

    ok thanks, so the best way is to assign a name using the widget’class and then style it in the css file of the child theme, right? 🙂

    #5548

    Andrew Misplon
    Keymaster

    Yes, that gives you the most flexibility and also a wide application. You can make a change in one place and have it impact many widgets/pages in the future.

    #5549

    Nube
    Participant

    Thanks 🙂

    #5553

    Andrew Misplon
    Keymaster

    For sure.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

Scroll to top