gpt4 book ai didi

html - 我正在尝试使用 css 设置页脚,我需要有 2 行

转载 作者:行者123 更新时间:2023-11-28 15:12:09 25 4
gpt4 key购买 nike

我有这个 CSS:

            @page {
size: letter;
margin: 15mm;
@top-center {
font-family: Arial Unicode MS;
content: "Header stuff- blah blah";
}

@bottom-center {
content: "Page " counter(page) " of " counter(pages);
}

}

我有一个转换为 PDF 的 Visualforce 页面,CSS 非常适合在每个页面的底部提供一个页面计数器。最终,VF 页面仅包含 html。

我想在每个页面的页面计数器上方的页脚中添加一个 URL,但我无法弄清楚。

有什么想法吗?

谢谢!

最佳答案

你需要两件事:

  • 插入通常不允许在content 中使用的换行符, 这可以用 \A 来完成(十六进制的 A = 十进制的 10。“新行”,通常显示为 \n 是 ASCII 表中的第 10 个字符)
  • 您需要尊重换行符,开箱即用的多个空格、制表符等在 HTML 中很乐意被忽略(这就是我们使用 <br> 等的原因)

    <apex:page sidebar="false" showHeader="false" applyHtmlTag="false" 
    standardStylesheets="false" readonly="true"
    renderAs="pdf">
    <html>
    <head>
    <style type="text/css">
    @page {
    size: A5 landscape;
    @bottom-right {
    content: "https://stackoverflow.com\A" counter(page) " of " counter(pages);
    white-space: pre-line;
    }
    }
    </style>
    </head>
    </html>
    </apex:page>

关于html - 我正在尝试使用 css 设置页脚,我需要有 2 行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48117976/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com