简体   繁体   English

如何将SharePoint:CssRegistration添加到SharePoint 2010中的母版页

[英]How to add SharePoint:CssRegistration to a Master page in SharePoint 2010

I must be doing something silly but I just can't get this to work. 我一定在做些愚蠢的事情,但我无法使它正常工作。 I'm trying to expand the width of the left Navigation pane where the Quick Launch and TreeView is located. 我正在尝试扩展快速启动和TreeView所在的左侧导航窗格的宽度。 From what I've dug up I understand the best to do this is to use an additional CSS file to override the s4-leftpanel style. 根据我的研究,我知道最好的方法是使用其他CSS文件覆盖s4-leftpanel样式。

So I've created a file at /Style Library/NavigationWidth/NavigationWidth.css and added the following line to the v4.master: 因此,我在/ Style Library / NavigationWidth / NavigationWidth.css中创建了一个文件,并将以下行添加到v4.master中:

<SharePoint:CssRegistration name="/NavigationWidth/NavigationWidth.css" After="corev4.css" runat="server"/> 

I'm pretty sure the path is probably wrong, tried a couple different combinations but no joy. 我很确定路径可能是错误的,尝试了几种不同的组合,但没有喜悦。 And where exactly is the best place to add this tag in v4.master? 在v4.master中添加此标签的最佳位置到底在哪里?

My Googling skills and proving extremely useless for this one so I'd be super grateful if someone can point out my error(s) please! 我的Google搜寻技巧并为此证明极其无用,因此,如果有人可以指出我的错误,我将不胜感激! Thanks. 谢谢。

It looks like the path to the file isn't valid. 看来文件路径无效。 Try adding it this way: 尝试通过以下方式添加它:

<SharePoint:CSSRegistration name="/Style Library/NavigationWidth/NavigationWidth.css" runat="server" After="corev4.css" />

If you look at the path in reverse: this will add the CSS file in the NavigationWidth folder in the Style Library (library) in the root of the Site Collection. 如果您反向查看路径:这会将CSS文件添加到网站集根目录中的样式库(库)的NavigationWidth文件夹中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM