Steve Bullman Posted October 22, 2018 Share Posted October 22, 2018 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 More sharing options...
Rikki Posted October 22, 2018 Share Posted October 22, 2018 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 More sharing options...
Steve Bullman Posted October 22, 2018 Author Share Posted October 22, 2018 Thanks for the quick response Rikki.ย Ok, I can just about manage those instructions.ย Been fiddling for ages trying to add css to blocks, some have worked, some haven't...some have applied the css to every block.ย This is a big help, thanks ย Link to comment Share on other sites More sharing options...
Rikki Posted October 22, 2018 Share Posted October 22, 2018 No problem ๐There's a lot you can achieve with some creative CSS selectors. Link to comment Share on other sites More sharing options...
Joel R Posted October 23, 2018 Share Posted October 23, 2018 Nominating this for CSS tip of the week. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.