Media Queries do not apply on a custom block I wrote
@alikabeer32 I'm facing the same issue. If you solved this issue. Can you please share the solution here. Thanks @umerrinayat I don't remember what I did but try the following: You need to define the css class and add a unique id to it ```js const cssComposer = editor.CssComposer; var sm = editor.SelectorManager; var...
Read full answer below βQuestion
I wrote a simple div block like so blockManager.add('simple-div', { label: 'Container', content: '"<!ββ<div class="simple-div"></div> ββ>"', category: 'Basic', attributes: { title: 'Simple Box', class: 'fa fa-square' } }); But it is NOT responsive whatsoever. This is how it is: 1.I set it's width 100% on desktop 2.I switch to tablet and set it's width 50% 3.I switch back to desktop and the width is still 50% There are also no media queries in the CSS (media queries work fine for images) Am I missing some code that allows it to be responsive? EDIT I just realised that that the styling is being...
Answers (2)
@alikabeer32 I'm facing the same issue. If you solved this issue. Can you please share the solution here. Thanks @umerrinayat I don't remember what I did but try the following: You need to define the css class and add a unique id to it ```js const cssComposer = editor.CssComposer; var sm = editor.S...
@alikabeer32 I'm facing the same issue. If you solved this issue. Can you please share the solution here. Thanks
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1034
Insert element or block inside parent element
Good day, i have component, have block i have Trait on listen changes, how can I add "h1 " inside that block "'<div class="container" style...
Issue #3207
Form is not submitting
I am trying to create as custom block. But the form is not submitting when i use components inside content. I am able to get all the form d...
Issue #1572
Issue when adding video block manually
I added Video Block manually like this. <pre> blockManager.add('video', { label: 'Video', category: 'Media', attributes: {class: 'fa fa-you...
Issue #2957
Unable to add <table> tag for custom block
Hi, I am trying to create a custom countdown timer block. The code is as follows: I am adding content inside 'table' tag. The moment I drag...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins β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.
Tutorial
Comparing GrapesJS Flavors: Core, Studio SDK, or Custom UI?
From out-of-the-box prototypes to production-grade SaaS editors, GrapesJS gives you several paths to market. We break down the trade-offs between them.
Tutorial
How Much Does It Cost to Build a SaaS Page Builder in 2026?
How much does it cost to build a SaaS page builder in 2026? Explore realistic development costs, timelines, features, and how using GrapesJS can reduce
Tutorial
UnStudio for GrapesJS: 4 Plugins to Build Better Visual Editors
Meet UnStudio, a new GrapesJS plugin studio with four tools, safer and better editor: Command Palette, Responsive Pack, Autosave & Restore, and Autofill
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.