Applying CSS code to all pages (e.g. master page)
-
11-12-2020 - |
题
- I am working on SharePoint 365 (2013).
- I saved code as a css file (exact code below)
CSS
/* Resize navigation fly-out width */
ul.dynamic {
width: auto !important; /* !important needed to override inline SharePoint style */
white-space: nowrap;
}
- I saved css file in Style Library
- I added content editor web part and pointed to the css file
- The home page took the changes and allowed the width of the drop down menus to increase
My issue. I am an extreme novice and have no idea how to make it "take" on all the other pages. As soon as I navigate off the home page, I lose that width change and it look sterrible.
Please help!!
解决方案
To Apply CSS code to all pages , follow the mentioned steps below :
- Open Site > Site Settings .
- Below Look and Feel > Click on (Master Page) or Design Manager.
- At Site Master Page Settings > Scroll down till
Alternate CSS URL
- Check
Specify a CSS file to be used by this site and all sites that inherit from it:
- Browse to your CSS file
- Check
Reset all subsites to inherit this alternate CSS URL
if you need to apply CSS for all subsites.