Issue #653✓ SolvedOpened December 15, 2017by gerabu2 reactions

Defautl class on block

快速解答by juanj2

To achieve this, you need to add the style separated from the block and set the classes to the block. Look for example how this is done in the basic blocks plugin: https://github.com/artf/grapesjs-blocks-basic/blob/master/src/index.js#L29

Read full answer below ↓

Question

I'm trying to add a custom block 1

and work fine, except that the styles attributes are set to a default class, for example 2

i want those css attributes be set to the class i'm setting in the classes attribute ('header-banner') how can i do that?

Answers (3)

artfDecember 19, 2017

You can also do this

content: `
	<div class="header-banner">...</div>
	<style>
		.header-banner {
			...
		}
	</style>
`
lock[bot]September 18, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Related tutorials

In-depth guides on the same topic.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.