Issue #2601πŸ’¬ AnsweredOpened February 26, 2020by cristianumali221 reactions

Dragging second block don't haveCSS

Quick answerby rjrodriguezalvarez97❀ 1

Try styling with classes as selector rather than ids

Read full answer below ↓

Question

Hi! I've manage to create different blocks with their own HTML and CSS using BlockManager. But once I drag the same block, the CSS is not working. I've already debug it. And I found that its renaming the my blocks' id. Example. I have a table with an id of custom-table. And when I drag the same table, the id becomes custom-table-2. But the css with a selector of #custom-table does not change. So it will not get the style. How to fix this issue. Thank you

Answers (2)

rjrodriguezalvarez97β€’ March 2, 2020

Try styling with classes as selector rather than ids

artfβ€’ March 3, 2020

You can't have multiple elements with the same ID (against also HTML5 specs) so the editor tries to fix that, so yeah, you have to use classes

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 β†’

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.