css - 我可以在 Quill 编辑器中向段落添加类吗?

标签 css quill

有没有办法让 Quill 编辑器在每个 div 上插入一个类,以便我可以使用 CSS 而不是 br 标签来调整段落间距?

这是其中一个示例,它使用了那些 br:

<div class="ql-editor" id="ql-editor-1" contenteditable="true">
  <div>
      <span style="font-size: 18px;">One Ring to Rule Them All</span>    
  </div>
  <div>
    <a href="http://en.wikipedia.org/wiki/One_Ring">http://en.wikipedia.org/wiki/One_Ring</a>
  </div>

  <div><br></div>

  <div>Three Rings for the <u>Elven-kings</u> under the sky,</div>
  <div>Seven for the <u>Dwarf-lords</u> in halls of stone,</div>
  <div>Nine for <u>Mortal Men</u>, doomed to die,</div>
  <div>One for the <u>Dark Lord</u> on his dark throne.</div>

  <div><br></div>

  <div>In the Land of Mordor where the Shadows lie.</div>
  <div>One Ring to <b>rule</b> them all, One Ring to <b>find</b> them,</div>

  <div>One Ring to <b>bring</b> them all and in the darkness <b>bind</b> them.</div>
  <div>In the Land of Mordor where the Shadows lie.</div>
</div>

最佳答案

<br>标签仅用于空行,它们不是可选的。影响 Quill 行的 CSS 的最佳方法是使用后代选择器。

关于css - 我可以在 Quill 编辑器中向段落添加类吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33835754/

相关文章:

javascript - 如何调整羽毛笔编辑器的大小以适应 <div>?

javascript - 为什么 Quill 会过滤它的内容?

html - 右边不工作但左边在位置 : absolute;

primefaces - p :textEditor <br> line separator instead of <p>

quill - 如何创建完全如示例中所示的 QuillJS 工具栏?

javascript - 如何在 quilljs 的代码块中指定附加类

php - 使用 php $this->beginBody() 和 endBody() 时视口(viewport)被忽略

css - 如何正确加载字体

css - 无法将 SCSS 值分配给 css 自定义属性(css 变量)

javascript - 如何多次打开一个div对应不同的按钮点击