In SharePoint 2013, I'm trying to include a reference to an additional CSS file but am not getting this to work. Here is the process I've followed:
I know the CSS works when I paste it into a Script Editor on a page, but of course I don't want to do that on every page. But the reference to it clearly doesn't work. Here are versions I've tried based on various websites. The first line is always on:
<SharePoint:CssRegistration ID="CssRegistration1" Name="Themable/corev15.css" runat="server" />
These other lines were tried one at a time, based on various articles on the web. None work.
<SharePoint:CssRegistration ID="CssRegistration2" Name="<% $SPUrl:~SiteCollection/Style Library/CustomCSS_OAMC.css %>" After="corev15.css" runat="server" />
<SharePoint:CssRegistration ID="CssRegistration3" name="<% $SPUrl:~sitecollection/Style Library/CustomCSS_OAMC.css %>" runat="server" />
<SharePoint:CssRegistration ID="CssRegistration4" Name="<% $SPUrl:~SiteCollection/Style Library/CustomCSS_OAMC.css%>" runat="server" />
My style sheet code is below for reference"
<style type="text/css">
#sideNavBox { display: none; }
#contentBox { margin-left: 20px; }
#topNav { margin-top: 50px; }
#siteIcon { height: 100px; }
.ms-siteicon-img {
max-height: 200px;
max-width: 500px; }
#s4-bodyContainer #titleAreaBox.ms-table, #s4-bodyContainer #titleAreaBox >
#titleAreaRow {display:block;}
#s4-bodyContainer #titleAreaBox > #titleAreaRow > #siteIcon
{float:left;display:block;margin:0 auto;}
</style>
Recently even I tried to create copy of Seattle master page, Also i needed to apply some custom css to the master page. You can find head section and under SharePoint's default css references place css reference with link tag that's it.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.