Issue #2051✓ SolvedOpened May 30, 2019by alikabeer322 reactions

Can I give default styling to an html tag like <p>?

快速解答by artf2

You can pass all the styles you want to your initial template

Read full answer below ↓

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)

👍 Most helpfulartfMay 31, 2019

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, 2019

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

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.