Tag Info

Hot answers tagged

5

I would advise against this...I would also advise against having an exact copy of the coreV4.css file. Having both these files is going to beef up the load times and increase the needless amount of code the browsers need to go through. Change your CSS registration to the following line. I also always add it after the CoreV4.css not that it makes a ...


4

I've also observed what you have; beyond ensuring that your CSS comes after core.css/corev4.css, the CSSRegistration.After property plainly doesn't work. I've extensively tested CssRegistration by using it to link 10 different CSS files into one user control, and it completely ignored the dependencies I specified. Furthermore, the ordering seems completely ...


4

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 ...


3

I know exactly what you're looking for. While a debate about proper link tag usage and CSS storage folders is always a fun topic, realize none of that is your issue here. There are two components that allows you to add <link> tags to Page Layouts. First, you need to find the following lines of code in the head of the Page Layout's HTML page: ...


3

As you say, there is no media attribute. There are a couple of ways I can think of to handle this in SharePoint: Either use Device Channels to target different master pages to different devices Or, add all of your responsive CSS to one file, containing the @media wrappers. This will also be better since if you for example resize your browser window, you ...


3

To do this properly, leave corev4.css alone and define your own custom CSS file that includes only the CSS classes that you want to override. CSS loads in order so as long as your custom CSS is loaded after corev4, your styles will be applied. Since your new file includes only the CSS classes that were modified, it will also be much easier to manage than ...


3

Another method to add the CSS is to create the CssRegistration object in the C# codebehind for the web part, and add your instance of CssRegistration to the web part's control hierarchy using this.ChildControls.Add(). You'll need to ensure this code is done within CreateChildControls override of the web part.


3

URLs in CSS files are always relative to the CSS file itself. If you have assets to reference that are in the same (or close) location (for example, in Style Library or similar), you can simply use paths relative to the CSS file. If you are referencing assets from within _layouts or _layouts/images, that's just as easy. These are configured as virtual ...


2

If it is SharePoint List form, you can simply make the fields as Required and SharePoint will handle it... But if its some other form, which I think it is... you can use JavaScript like this: <script type="text/javascript"> function onSubmitValidation() { if (TrimAll(document.getElementById("field1").value) == "") { alert('All fields are ...


2

recently we had the same probleme with our site which should open in IE8 document mode. Whenever we set to display IE8 mode no changes! To fix this we had modified web.config file and added these lines <configuration> <system.webServer> <httpProtocol> <customHeaders> <clear /> <add ...


2

i dont think your doing it properly! <SharePoint:CssRegistration Name="<%$SPrl:~sitecollection/Style Library/MyCustomTheme/mycss.css%>" runat="server" After="corev15.css"/> you were doing "<% $SPUrl=~ instead of "<%$SPrl:~ http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.cssregistration.aspx EDIT try ...


1

Possibly you set incorrect URL to your css file. You can try to see url using debug mode of a browser (usually you can press F12 for that) and then you could try to open this link directly in a browser window to see if it is accesible. Also you can take a look at a conversation about different places to keep CSS files. Maybe you find it useful.


1

It seems that the problem arise when your master pages are not located in the Master Page Gallery. The problem went away when I added the master page to the master page gallery and referenced it from there (i.e. _catalog/masterpage/mymasterpage.master) instead of the _layouts folder. The actual server deployment location of the master page is still in the ...


1

A very effective and easy way is to store the css files either in the file system or in the style library(I vote for the first one). First create a css file with the style definitions you want and save it in the structure in Visual Studio of a SharePoint Project. The files could either be copied to SharePoint root or to a SharePoint library on deployment. ...


1

If you don't want to edit master pages or page layouts I usually store the CSS in a document library (or asset library) on the same SharePoint site. Then I add content editor web part (CEWP) to the page to 'insert' this css into the page. Disadvantage is that you need to add that CEWP to every page where you want to apply the styling. I have once written ...


1

Place your CSS file under the master page gallery with the SharePoint designer (_catalogs/masterpage) On your master page file on the header zone call the CSS like the example bellow <SharePoint:CssRegistration name="<%$SPUrl:~sitecollection/_catalogs/masterpage/bindtuning.css%>" runat="server" after="SharepointCssFile" />


1

Since you have packaged your branding elements including master page, css, images, js, etc into a feature (scoped to site), then I recommend that you activate this feature on each site collection (root site and sub site collections, i.e. yourdomain/sites/subsite1). The feature should include a module to transfer _catalogs/masterpage assets and at least ...


1

I believe the issue here requires clearing the issue of "root site collection vs other site collections" as each Site Collection in its own is an Isolation boundary, be it root or not. Basically the practice of deploying at Site Collection level (e.g. using Style Libraries) is a recomanded practice, and also it does follow the same isolation unit as the Site ...


1

OK. So if you have a directory structure like this: Folder1/ Folder1/images/image1.png Folder1/css/style.css (This can be inside any folder eg: _layouts, _layouts/1033/Styles etc) To refer to the image1.png from the style.css, all you have to do in the style.css is: '../images/image1.png' The "../" in the start will look for the images directory one ...


1

Yes, use the CssRegistration control to add your own CSS files. They are inserted into the page using the CssLink conrol in the masterpage. Hint: Use the After property to load your css file after a specific file, such as 'corev4.css'. This will let you define the load order of your CSS. You can insert your three instances of CssRegistration into a new ...



Only top voted, non community-wiki answers of a minimum length are eligible