[QUESTION/BUG?] Dragging second block don't haveCSS
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)
Try styling with classes as selector rather than ids
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.
Issue #481
Question: Dragging blocks into a Text block?
This is not a bug but an implementation question. If this is not the right place to ask these questions, please let me know. We're working...
Issue #2596
[QUESTION] Add html, css and js to Block Manager
[QUESTION] Hi! I'm retrieving dynamic html,css and js codes from the database. How can I create Blocks with this? Currently, this is my cod...
Issue #2177
How to create a block with HTML and CSS and javascript content.
Can somebody please show me a code example of how to create a block with javascript and css styles. The main problem is that the js code is...
Issue #3119
[QUESTION] How to create custom block made of grapesjs components?
Hi, i want to have custom blocks made of grapesjs components. I found solution how to add components: https://github.com/artf/grapesjs/issu...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.