gpt4 book ai didi

c# - 图像路径在 CDN 中有效,但在 .css 中无效

转载 作者:太空宇宙 更新时间:2023-11-04 12:12:13 24 4
gpt4 key购买 nike

我不明白。它如何与 CDN 一起工作,而不是当我将 CSS 复制到本地 .CSS 并通过 MVC 中的 BundleConfig.cs 引用它时?我什至不知道在哪里可以找到图像。

Works CDN:(在数据表标题中给出向上/向下箭头)

@Styles.Render("http://cdn.datatables.net/plug-ins/9dcbecd42ad/integration/bootstrap/3/dataTables.bootstrap.css")

不起作用:.CSS

BundleConfig.cs:

bundles.Add(new StyleBundle("~/Content/dataTablesBootstrap").Include(
"~/Content/dataTables-bootstrap.css"
));

_Layout.cshtml:

@Styles.Render("~/Content/dataTablesBootstrap")

错误:

"NetworkError: 404 Not Found - http://localhost/WebConsole53/images/sort_both.png"

最佳答案

我建议您从这里下载 ZIP:datatables.net/下载/下载。

将 CSS 文件复制到您的:

/Content/样式

并将您的图片复制到

/images/

它应该可以工作。我认为您不必更改 css 文件中的引用

如果

/content//images/ 文件夹在同一个目录下

关于c# - 图像路径在 CDN 中有效,但在 .css 中无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28964662/

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