gpt4 book ai didi

css - Laravel - barryvdh pdf - 如何将外部 css 文件包含到 html View 中

转载 作者:行者123 更新时间:2023-11-28 10:01:30 24 4
gpt4 key购买 nike

我在创建 pdf 文件时遇到问题。我将 css3 文件包含到 View 的 head 部分,但它不起作用。
包含的文件是 twitter bootstrap css 和应用程序主题的主 css。

...
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link type="text/css" media="all" rel="stylesheet" href="packages/bootstrap/css/bootstrap.min.css">
<link type="text/css" media="all" rel="stylesheet" href="css/dashboard/style.min.css">
</head>
...

有想法吗?

最佳答案

我通过在 href 属性中输入 public_path 来解决这个问题,遵循 https://github.com/barryvdh/laravel-dompdf/issues/121#issuecomment-358245406 中的说明:

<link href="{{ public_path('css/pdf.css') }}" rel="stylesheet">

注意:我使用的是本地虚拟服务器。我希望这对你有用。

关于css - Laravel - barryvdh pdf - 如何将外部 css 文件包含到 html View 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26411221/

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