css - Simple way to add custom class and ids to individual Gutenberg blocks

admin2025-06-07  43

Is there a simple way to add classnames to individual core Gutenberg blocks?

Blocks is a great step toward moving to a web where HTML structurally/functionally describes elements, which are styled elsewhere in CSS. However, this is limited in that blocks cannot be easily classed?

I'd be happy with a plugin that extends existing (or custom) block functionality to include classes and ids.

Is there a simple way to add classnames to individual core Gutenberg blocks?

Blocks is a great step toward moving to a web where HTML structurally/functionally describes elements, which are styled elsewhere in CSS. However, this is limited in that blocks cannot be easily classed?

I'd be happy with a plugin that extends existing (or custom) block functionality to include classes and ids.

Share Improve this question asked Oct 4, 2018 at 20:36 Wes ModesWes Modes 2151 gold badge3 silver badges9 bronze badges 2
  • Possible duplicate of Add custom class to core blocks in Gutenberg – Jacob Peattie Commented Oct 5, 2018 at 1:15
  • Not a duplicate. The referenced article asks how to add permanent classes to core blocks at the code level. I was asking how to add classes dynamically from the admin interface. – Wes Modes Commented Oct 6, 2018 at 2:43
Add a comment  | 

1 Answer 1

Reset to default 1

Every block has a field for custom CSS classes in the 'Advanced' panel:

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1749242564a317554.html

最新回复(0)