字体大小/字体系列无效

发布于 2024-09-02 07:54:54 字数 837 浏览 4 评论 0原文

这是与我之前的问题相关的问题。

我已经修改了前言标题建议的代码,以修改标题下方的 p 标签。

<xsl:template match="topic[title='Preface']/body/section/p">
        <fo:block xsl:use-attribute-sets="preface.p">
            <xsl:apply-imports/>
        </fo:block>
    </xsl:template>

<xsl:attribute-set name="preface.p">
        <xsl:attribute name="font-family">Helvetica</xsl:attribute>
        <xsl:attribute name="color">red</xsl:attribute>
        <xsl:attribute name="font-size">8pt</xsl:attribute>
    </xsl:attribute-set>

颜色改变了所需的文本 - 并且仅改变了所需的文本,所以我知道它正在抓取正确的节点。但是,字体系列和大小没有影响。

有谁知道我可以检查哪些可能会覆盖代码的内容?

This is a related issue to my previous question.

I have modified the code suggested for preface headings to modify the p tags underneath the headings.

<xsl:template match="topic[title='Preface']/body/section/p">
        <fo:block xsl:use-attribute-sets="preface.p">
            <xsl:apply-imports/>
        </fo:block>
    </xsl:template>

<xsl:attribute-set name="preface.p">
        <xsl:attribute name="font-family">Helvetica</xsl:attribute>
        <xsl:attribute name="color">red</xsl:attribute>
        <xsl:attribute name="font-size">8pt</xsl:attribute>
    </xsl:attribute-set>

The color changes the desired text - and only the desired text, so I know it is grabbing the correct nodes. However, the font family and size have no effect.

Does anyone know of anything I can check that might be over-riding the code?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

尘曦 2024-09-09 07:54:54

HTML 没有属性 font-familyfont-size,它们是 CSS 属性,试试这个:

<xsl:attribute-set name="preface.p">
    <xsl:attribute name="style">font-family: Helvetica; color: red; font-size: 8pt;</xsl:attribute>
</xsl:attribute-set>

HTML doesn't have the attributes font-family or font-size, they are CSS properties, try this:

<xsl:attribute-set name="preface.p">
    <xsl:attribute name="style">font-family: Helvetica; color: red; font-size: 8pt;</xsl:attribute>
</xsl:attribute-set>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文