【问题标题】:HTML Styling with Google API - Text-indent使用 Google API 进行 HTML 样式设置 - 文本缩进
【发布时间】:2018-03-19 06:53:01
【问题描述】:

我有一个 chrome 扩展程序,它创建 MLA 引用并将它们上传到谷歌驱动器。它工作正常,样式也有效。但是,文本缩进属性被忽略。我正在使用谷歌的驱动器 API 发送文件。我需要知道如何能够使用该属性,所以它看起来像这样:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam erat 
    velit, lobortis quis ipsum non, dapibus tincidunt dolor. Integer 
    commodo, metus ac commodo scelerisque, est erat faucibus neque, vel 
    commodo odio sapien ac nisl. Cras scelerisque mi id venenatis 
    fringilla.

发送的html:

html += '<p dir="ltr" style="line-height:2.0;margin-top:0pt;margin-
bottom:0pt;padding:0pt 0pt 0pt 36pt;text-indent: -36pt;"><span 
style="font-size: 12pt; font-family: &quot;Times New Roman&quot;; 
vertical-align: baseline; white-space: pre-wrap;">' + text + '</span></p>';

其他数据

  • 转换:真
  • 上传类型:多部分
  • GData-版本:3.0
  • mimeType:文本/html

分机号:https://chrome.google.com/webstore/detail/ezcite/hglaojinolkdpdnnnhlohffjpckcodjh

【问题讨论】:

    标签: google-drive-api


    【解决方案1】:

    我想出了如何解决这个问题:我没有使用 style 属性导出,而是将 css 放入一个 style 元素中,并为 body 引用了正确的类。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-09-25
      • 2011-08-17
      • 2012-11-27
      • 1970-01-01
      • 2021-11-27
      • 1970-01-01
      • 2013-10-29
      相关资源
      最近更新 更多