skip to Main Content

I’m trying to change the background color of a custom html WordPress block, but when I access this block, I change the background color of all custom html blocks from other pages

this is the CSS instruction I am using:

#main.site-main.post-single.order-first{ background-color: #212529; }

I expected the background color of the custom html block to only be changed on this page, however it was also changed on another page which also has a custom html block

2

Answers


  1. In the block settings in the WordPress editor (i.e. the column at the right side of the window), there is the option to assign a class to a block (all the way at the bottom of the column). Do that, use a unique name for it and create a CSS rule for that class with the desired settings.

    Login or Signup to reply.
  2. try this..

    #main.site-main.post-single.order-first{ background-color:  #212529!important; }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search