Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 7025

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 2162

Deprecated: Hook imagify_allow_picture_tags_for_webp is deprecated since version 2.2! Use imagify_allow_picture_tags_for_nextgen instead. in /www/collab365_296/public/wp-includes/functions.php on line 5758
How to remove the SharePoint header, footer and menus with CSS - Collab365
Deprecated: strstr(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1145

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1152

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1155

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1162

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1165

Deprecated: strstr(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1145

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1152

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1155

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1162

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1165

Warning: Undefined array key "url" in /www/collab365_296/public/wp-content/plugins/thrive-visual-editor/thrive-dashboard/inc/smart-site/classes/class-tvd-smart-shortcodes.php on line 85

2013-06-05

Sometimes, there’s the need to include Sharepoint web pages in external web applications without showing elements derived from the master page (i.e. ribbon, navigation bars, title bar, etc.). The CSS snippet below is an easy way to hide unwanted elements by using CSS only, without changing the ASPX code.

1: Create a CSS file named (for example) zero.css in the Style Library as follows

<style type="text/css"> 
/* Resizes to 0 the upper margin of the main area */ 
.ms-pagetitleareaframe table { background: none; }
/* Hides the left navigation area (quick launch bar) */
#s4-leftpanel-content { display:none !important; } 
/* Resizes to 0 the left margin */  
.s4-ca { margin-left:0px !important; margin-right:0px !important; } 
/* Hides title and breadcrumb bar */  
.s4-title { display:none !important; } 
/* Hides the top navigation links */     
.s4-tn { display:none !important; } 
/* Hides the top navigation container bar */
.s4-notdlg { display:none !important; }
/* Hides the search box */  
#SRSB { display:none !important; } 
/* Hides the help button */     
.s4-help { visibility: hidden; } 
/* Hides user name in the top right corner and the related menu */     
.s4-trc-container-menu { visibility: hidden; } 
/* Hides the ribbon */  
.ms-cui-ribbonTopBars{ display:none; }  body #s4-ribbonrow { min-height: 0 !important; display:none !important; } 
</style>

2: link the CSS file in the desired master page by adding this line:

<link href="/Style%20Library/zero.css" rel="stylesheet" type="text/css" />

just above this line: <asp:ContentPlaceHolder id=”PlaceHolderAdditionalPageHead” runat=”server”/>

I suggest not to edit the original master page, but to make a copy and modify it.

I noticed slight differences in display, depending on the edition and version of Sharepoint. The code is substantially the same, but may require a minimum adjustment to the context.

(Visited 1,220 times, 1 visits today)

About the author 

Mauro Zanetti

Summit Bundle

Get 200+ hours of Microsoft 365 Training for 27$!

Master Office 365, Power Platform & SharePoint & Teams With 200+ Hours Of Training Videos and 108 Ebooks in the Collab365 Academy. This offer is insane and is only available for a limited period.