Issue #2051Opened May 30, 2019by alikabeer322 reactions

[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)

artfMay 31, 20192 reactions

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}',
  });
alikabeer32May 31, 20190 reactions

Exactly what I needed, Thanks!!

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...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.