Jump to content

Ability to add css classes to blocks


Steve Bullman

Recommended Posts

Someones probably going to tell me this already exists, or theres an obvious work around but...

It would be really handy for people like myself who can just about work their way around css to have the ability to add a css class when creating a block, much like most of the wordpress page builders allow.

Link to comment
Share on other sites

Blocks all have a unique 'blockid' attribute, which you can use in CSS to target that block. For example:

[data-blockid="app_gallery_albums_lqslwgew6"] {
	background: red;
}

You can find that ID by using web inspector to select the block on the page and looking at the DOM. That line above matches a specific block; if you have multiple blocks of the same type, you could target them all by doing (note the ^=)

[data-blockid^="app_gallery_albums_"] {
	background: blue;
}

ย 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
ร—
ร—
  • Create New...