[QUESTION] Can I give default styling to an html tag like <p>?
Question
I want that p tag should always have 0 margin. How do I do that? The reason is that ckeditor is wrapping the text around a p tag and p tag has a margin that's making it all ugly.
Answers (2)
You can pass all the styles you want to your initial template
const editor = grapesjs.init({
container : '#gjs',
components: '<div class="txt-red">Hello world!</div><p>Text</p>',
style: '.txt-red{color: red} p {margin: 0}',
});
Exactly what I needed, Thanks!!
Related Questions and Answers
Continue research with similar issue discussions.
Issue #2170
[QUESTION] Custom component - how to set editable to true
Hi, I've created a custom component type, but I am having some trouble making it editable. The component is a "span" with component type "t...
Issue #3019
[QUESTION] - Bind inner text/html (like div, p, h1) to Trait
Hi! I've created a custom trait, and I want to be allowed to change the content of the tags (in this case it's a H1 tag) based on the trait...
Issue #916
[Question] why do layers not have element tag name?
I'm playing around with grapes' internals because I would like to contribute in the future. Most of my interest is in making it worth with...
Issue #3091
[QUESTION] How to use grapesjs with static HTML
Sorry in advance for my English. I'm developing a CMS using Laravel and Vue.js. I want to use grapesjs for editing page content but with st...
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.