gpt4 book ai didi

javascript - 如何更改骨架自动加载的样式表的路径

转载 作者:行者123 更新时间:2023-11-28 06:41:53 25 4
gpt4 key购买 nike

我使用响应式 UI 样板框架。而且我也用springmvc。所以我需要将静态资源映射到一个目录,以便它们可以正确加载。

<mvc:resources mapping="/resources/**" location="/resources/" />

在我的 jsp 文件中

<head>
<title>Plain Art | 艺术品定制</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<link href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700,900,300italic" rel="stylesheet" />
<script src="<c:url value="/resources/js/jquery.min.js"/>"></script>
<script src="<c:url value="/resources/js/jquery.dropotron.js"/>"></script>
<script src="<c:url value="/resources/js/config.js"/>"></script>
<script src="<c:url value="/resources/js/skel.min.js"/>" ></script>
<script src="<c:url value='/resources/js/skel-panels.min.js'/>" ></script>
<noscript>
<link rel="stylesheet" href="<c:url value='/resources/css/skel-noscript.css'/>" />
<link rel="stylesheet" href="<c:url value='/resources/css/style.css'/>" />
<link rel="stylesheet" href="<c:url value='/resources/css/style-desktop.css'/>" />
</noscript>

<!--[if lte IE 8]><script src="<c:url value='/resources/js/html5shiv.js'/>"></script><link rel="stylesheet" href="<c:url value='/resources/css/ie8.css'/>" /><![endif]-->
</head>

当我启动服务器并加载页面时,<head>呈现如下

enter image description here

我想更改样式表的路径,但我找不到 skel.min.js 中的哪些代码块控制加载 style-desktop.cssstyle-mobile.css .

我在浏览器检查器中手动更改源

<link href="css/style.css" type="text/css" rel="stylesheet">
<link href="css/style-desktop.css" type="text/css" rel="stylesheet">

进入

<link href="/Project/resources/css/style.css" type="text/css" rel="stylesheet">
<link href="/Project/resources/css/style-desktop.css" type="text/css" rel="stylesheet">

并且可以正确加载样式表。但它会响应地更改 .css 文件。当我切换到移动尺寸时,它会自动加载 style-mobile.css,这也会导致问题。

我的问题是:1)如何更改错误的路径并使其与spring mvc兼容?2)是否有另一种引用静态资源的方法?而不是使用标签

提前致谢。

最佳答案

您是否尝试过将映射设置为以下内容?

<mvc:resources mapping="/resources/**" location="/Project/resources/" />

关于javascript - 如何更改骨架自动加载的样式表的路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34240945/

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