Hot answers tagged

7

If you have deployed the CSS file to the Style Library or an Assets library, make sure it is checked in as a major version and approved. It could be possible that your page layout is not published and approved as well. This is the typical symptom when an asset is not approved, it works fine for admins but not general users.


7

You can put your script inside an EditModePanel control. Setting the PageDisplayMode property determines when it shows on the page. I use them for setting different CSS on a page layout during editing and they would be perfect in your scenario. Look at some of the OOTB page layouts for examples.


6

You would want to create an alternate css file. In it you would do .ms-pub-contentLayout { background-color: rgba(255, 255, 255, 1); } Save this css file in your site, then apply it using the Alternate CSS URL option in the MasterPage options, accessible via Site Settings, Master page, Alternate CSS section aka /_layouts/15/ChangeSiteMasterPage.aspx.


5

Add an id: <pre id="myId" .... And then hide it with jquery: addNewTest = function() { $('#myId').hide(); }); or without jquery: addNewTest = function() { document.getElementById('myId').style.display = 'none'; });


5

I have been using Mavention minifier tool. It is working as expected and you can apply this on the particular files that you wanted. MaventionMinifiedCssFileGenerator - for minifying CSS files MaventionMinifiedJsFileGenerator - for minifying JavaScript files MaventionObfuscatedJsFileGenerator - for minifying and obfuscating JavaScript files are the ...


5

I guess you could always use a site collection token in your URL. ~sitecollection URLs and tokens in SharePoint 2013 If that don't work out for you, this blog post has a lot of great examples when working with masterpages and references. Use Site Url in SharePoint Update Try using a scriptlink instead. I'm unsure if encoding is needed thought. Try to ...


4

You wanna target the specific webpart where you wanna change the link color, otherwise every link on the page will change font color. Use F12 Developer tools to find the ID of the specific webpart you wanna change the link text for. Insert the name/ID instead of my example (#WebPartWPQ5) and then use the CSS i provided below (SP2013). <style ...


4

Find id of that WP. Something like WebPartTitleWPQ4. Edit that page and insert script editor WP and add <style> <style> #WebPartTitleWPQ4 h2 { background-color: #000; color: #fff; } </style> EDIT Find where is title. For ex. <style> #WebPartTitleWPQ4 h2 { background-color: #000; } #WebPartTitleWPQ4 h2 span { ...


4

A ductape patch is adding a negative margin-top <div style="margin-top:-200px"> YOUR CONTENT </div>


3

If you are only looking to affect things within the main content portion of the page (and not the page title bar, quicklaunch, etc.), on wiki pages all the content is in a div with an ID like ctl00_PlaceHolderMain_WikiField. Knowing that, you could set up your CSS selectors to always start with div[id$='WikiField'] so that you will only be targeting ...


3

How about using the WebEssentials Extension. Bundling and minifying is just one feature you would get out of it. Others are: A lot of compilers and linters for CSS/JS. Additional Debugging functionality Bundling via XML (CSS/JS/Sprites) Better Intellisense and a lot more just check their homepage Btw. these Tools are added in VS2015 by default and are ...


3

I would recommend to use the 'Alternate CSS URL' for adding custom CSS to a SharePoint Site. Go to Site Settings -> Master Page -> 'Alternate CSS Url'. Browse for the custom CSS file and save it. This adds the CSS to the site without any change to the master page.


3

Your first approach is the best way to add a custom css file to a master page. Backing up master page and then creating a custom master page, adding custom CSS file to Style Library and then adding external CSS link under <head> tag. These steps are the most recommended and considered as best approach. Just make sure to add the external css link just ...


3

Update an oslo.css is not recommendable approach because it can break other elements which you might not find even. You should check with developer tools about the CSS. Which CSS is breaking the layout and try to override that CSS with your custom CSS in the masterpage. Here is the great solution Responsive SharePoint available that you can use with ...


3

Ideally, you would start by creating a copy, rather than editing one of the existing master pages. Which one you choose is purely up to your own aesthetics. Once you're familiar with their creation, you can create one from scratch and with the built in design tools (available through the front end, generates web parts and unique content). As to where to ...


3

You should be able to do this using custom js link for the default list view, check out these sample it will direct you on how to implement it. Client-side rendering (JS Link) code samples There is an awesome post which describes the appraoaches for JS Link check out: SP 2013: Using the JSLink property to change the way your field or views are rendered in ...


2

You can achieve this with what is called Client Side Rendering (CSR). These are the best articles I have come across on CSR and how to use it: SharePoint 2013 Client Side Rendering: List Views SharePoint 2013 Client Side Rendering: List Forms Note: Some people use the terms CSR and JSLink interchangeably, but they are NOT one and the same thing. CSR is a ...


2

I agree with the previous answers ! I have recently started using CSR to style both lists and some basic modifications to new / edit / display forms. Once you get going with it, there is quite a bit you can do. The links provided are excellent, I just wanted to add one of my own with a working script as I struggled to find examples that showed how to ...


2

You can use script Web part and insert a tag style .ms-headerSortArrowLink{visibility:visibility !important; } The important should override the in line style


2

Here’s the code you should put on your pages: <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <script type="text/javascript" src="http://path to the script/StickyHeaders_v2.9BETA.js"></script> You can download StickyHeaders_v2.9BETA.js from here


2

Add the css as: <style type="text/css"> div.ms-webpart-zone.ms-fullWidth { width: 700px; } </style> Note: This change will apply to all your webpart zone(s) in the page. To apply it to a particular element prepend the CSS with a unique element identifier.


2

Check in and publish as major version the masterpage


2

Most likely the location you saved the css file requires the document to be checked in and approved. Check that it is version 1.0 and approved.


2

If you use file system then during system backup those files will not get backed up. This is the same case with system migration. All files in file system needs to be moved separately. On the other hand if you use libraries then those files will be placed in the content database and will be included in backup as well as system upgrade etc. If you place ...


2

As a best practice, please make a copy of your seattle and oslo master pages. Change your site to inherit from your copy of seattle/oslo master page. In my case, I opened the custommaster.html and inserted the below CSS line <!--SPM:<SharePoint:CssRegistration name="&#60;% $SPUrl:~sitecollection/Style Library/custom.css %&#62;" ...


2

Most likely because your admin page has more content on the page thus pushing the footer down. You can fix the footer to the bottom with: footer { background: url('/_layouts/15/images/ForFarmers.Connect.Branding/bgfooter.png') right bottom no-repeat; z-index:100; position:fixed; bottom:0px; width: 100%; height: 160px; } But it will cover the ...


2

You can try something like this for example: /*here I am setting a background image for the webpart title:*/ .ms-webpart-chrome-title { vertical-align: middle; position: relative; margin-bottom: 2px; background-image: url(your iamge location); background-repeat: no-repeat; } You can also use Font awesome icons as well ...


2

I would recommend adding a custom action to the web object at the root. The guys at pattern and practice explains it well Basically create a css file with what you need, put it somewhere and add the custom action using (var clientContext = new ClientContext(rootUrl)) { clientContext.Credentials = new SharePointOnlineCredentials(username, pwd); var ...


2

If you go to site settings > Look and Feel > Master Page Click on Alternate CSS URL Click on Browse Click on Add a new item at the top of the window Select your custom CSS file (I will paste mine below) Once uploaded navigate to the new file, select it and click insert. Click OK on the Master Page settings page. If you do not select to use the same ...


2

Assuming you want to have a count of whether or not a list item's text column has a value, you can use the Totals properties of a view. Select the text field and then choose "Count" for the each field you require. Then, eliminate all fields from this view definition except those fields you are counting. And finally, you'll need to apply CSS (to the view ...



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