我在我的自定义主页上使用了多个自定义stylsheets,但它在它们呈现的顺序中很重要。在第一个我使用之后的属性:

<SharePoint:CssRegistration runat="server" ID="Custom1" Name="/_layouts/15/Custom1.css" After="corev15.css" />
.

但我也可以用我的自定义样式表这样做吗?我想要一些东西:

<SharePoint:CssRegistration runat="server" ID="Custom2" Name="/_layouts/15/Custom2.css" After="Custom1.css" />
.

但只写这似乎没有帮助,他们以随机顺序地插入,有时是正确的顺序,有时不是。我应该在“之后”中使用不同的路径,或者是不可能的吗?

感激答案!

有帮助吗?

解决方案

Try adding the path, as you have done in Name also, in After. Or since you have the css files directly in the 15, remove the path from the Name property.

First option:

<SharePoint:CssRegistration runat="server" ID="Custom2" Name="/_layouts/15/Custom2.css" After="/_layouts/15/Custom1.css" />

Second option

<SharePoint:CssRegistration runat="server" ID="Custom2" Name="Custom2.css" After="Custom1.css" />
许可以下: CC-BY-SA归因
scroll top