【问题标题】:Define paragraph spacing in word included html在 word 包含的 html 中定义段落间距
【发布时间】:2015-01-20 17:53:09
【问题描述】:

我使用 includetext-function 将 html* 包含到 ms word 2010 文档中:

{ INCLUDETEXT  "test.html" }

那是html:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
      body {         
         line-height: 100%;                  
         }     
      p {         
         margin: 0px;
         padding: 0px;
         }

   </style>
</head>
<body>
<p>Line 1<br/>Line 2</p>
</body>
</html>

我没有设法在 html/css 中用 word 格式化段落间距。边距和填充属性都不起作用。我检查的所有其他 css 属性(字体*、空白、颜色)都工作正常。

没有&lt;p&gt;-tag 单词将段落间距设置为10 pt,在&lt;p&gt;-tag 内,我得到“自动”,这也给我的完整文档带来了麻烦。

哪个css属性与单词兼容来定义段落间距?

非常感谢。

(* 带有 xslt 样式表的 xml - 但为了简化演示)

【问题讨论】:

    标签: html css ms-word paragraph


    【解决方案1】:

    在每个 p 标签中使用 id 或 class(我知道这很无聊,但请尝试一下)。我认为这可能会奏效。也可以试试文章或块引用标签

    【讨论】:

      【解决方案2】:

      只有在样式属性中添加属性时,才会接受边距属性。在 css 类中,word 会忽略它。

      这条线工作正常:

      <p style="margin:0">Line 1<br/>Line 2</p>
      

      奇怪的行为 :-(

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-05-06
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多