Laravel Snappy-如何加载内部/外部CSS [英] Laravel snappy - How to Load internal/external css

查看:51
本文介绍了Laravel Snappy-如何加载内部/外部CSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试让pdf文件的css样式起作用.到目前为止,还没有这种运气.

I am trying to get the css styling working for my pdf documents. So far no such luck.

  1. 是否可以使用CDN样式表文档?当我在视图的头部添加"bootstrap stylesheet cdn"时,出现以下错误;

  1. Is it possible to use CDN style sheet documents? When I add say bootstrap stylesheet cdn to my view's head section, I get the error below;

退出状态代码'1'表示出了点问题:stderr:正在加载页面(1/6)[>] 0%[======>] 10%[======>]11%错误:无法加载 https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css ,网络状态代码为3,http状态代码为0-找不到主机

The exit status code '1' says something went wrong: stderr: "Loading pages (1/6) [> ] 0% [======> ] 10% [======> ] 11% Error: Failed to load https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css, with network status code 3 and http status code 0 - Host not found

我尝试内联添加整个引导文件,在这种情况下,没错,但是flexbox似乎根本不起作用.仅样式的文本属性(字体背景颜色等)已更改.

I tried adding the entire bootstrap file inline, in that case, there is no error but it seems flexbox is not working at all. Only styling of text properties (font background color etc) changed.

我在这里想念什么?理想情况下,我在应用程序上使用tailwindcss,是否可以使用它?如果是这样,我该怎么办?

What am I missing here? Ideally, I use tailwindcss on my app, Is it possible for me to use that? If so, How could I do that?

推荐答案

(Laravel-流明)

(Laravel - Lumen)

helpers.php获得了路径: resource_path(),database_path(),base_path(),storage_path().

helpers.php got paths : resource_path(), database_path(), base_path(), storage_path().

使用 resource 路径,其中还包含 blade 文件.(易于管理)

Use resource path where the blade files also included. (easy to manage)

<link rel="stylesheet" href="{{ resource_path('views/pdf/invoice/css/styles.css') }}" media="all" />

这将链接 resource/views/pdf/invoice/css/文件夹路径中的 styles.css 文件.

This will link styles.css file in the resource/views/pdf/invoice/css/ folder path.

这篇关于Laravel Snappy-如何加载内部/外部CSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆