diff --git a/src/main/java/org/olat/core/commons/fullWebApp/BaseFullWebappController.java b/src/main/java/org/olat/core/commons/fullWebApp/BaseFullWebappController.java
index 79ec49ac714fb746b26a81a6dca072373ad52af5..d8bb21c808128aea85a7b1c61497ca4e3f8895f2 100644
--- a/src/main/java/org/olat/core/commons/fullWebApp/BaseFullWebappController.java
+++ b/src/main/java/org/olat/core/commons/fullWebApp/BaseFullWebappController.java
@@ -788,7 +788,8 @@ public class BaseFullWebappController extends BasicController implements ChiefCo
 	/**
 	 * Remove the current custom css from the view
 	 */
-	protected void removeCurrentCustomCSSFromView() {
+	@Override
+	public void removeCurrentCustomCSSFromView() {
 		Window myWindow = getWindowControl().getWindowBackOffice().getWindow();
 		CustomCSS currentCustomCSS = myWindow.getCustomCSS();
 		if (currentCustomCSS != null) {
@@ -803,7 +804,8 @@ public class BaseFullWebappController extends BasicController implements ChiefCo
 	 * 
 	 * @param customCSS
 	 */
-	protected void addCurrentCustomCSSToView(CustomCSS customCSS) {
+	@Override
+	public void addCurrentCustomCSSToView(CustomCSS customCSS) {
 		if (customCSS == null) return;
 		// The current CSS is stored as a window attribute so that is can be
 		// accessed by the IFrameDisplayController
diff --git a/src/main/java/org/olat/core/gui/control/ChiefController.java b/src/main/java/org/olat/core/gui/control/ChiefController.java
index 78276274458d4208b988b7f400253f0d90e17b64..4791a68aaa3788524d79208aff1c5b944a0ec94c 100644
--- a/src/main/java/org/olat/core/gui/control/ChiefController.java
+++ b/src/main/java/org/olat/core/gui/control/ChiefController.java
@@ -27,6 +27,7 @@
 package org.olat.core.gui.control;
 
 import org.olat.core.gui.components.Window;
+import org.olat.core.gui.components.htmlheader.jscss.CustomCSS;
 /**
  * Description: <br>
  * 
@@ -58,5 +59,19 @@ public interface ChiefController extends Controller {
 	 * @param cssClass
 	 */
 	public void removeBodyCssClass(String cssClass);
+	
+	/**
+	 * Add manually the custom CSS with an special timing to the view.
+	 * Don't forget to set the custom CSS in your main controller too. The
+	 * custom CSS is removed and readded at every tab/site changes.
+	 * 
+	 * @param customCSS
+	 */
+	public void addCurrentCustomCSSToView(CustomCSS customCSS);
+	
+	/**
+	 * 
+	 */
+	public void removeCurrentCustomCSSFromView();
 
 }
\ No newline at end of file
diff --git a/src/main/java/org/olat/core/gui/exception/ExceptionWindowController.java b/src/main/java/org/olat/core/gui/exception/ExceptionWindowController.java
index 5143098ffe4f1f715cd70fcddd5fbb6e46a89bac..9cf5f8bce1186a03ffe1561be73a72ee19d1b5b7 100644
--- a/src/main/java/org/olat/core/gui/exception/ExceptionWindowController.java
+++ b/src/main/java/org/olat/core/gui/exception/ExceptionWindowController.java
@@ -37,6 +37,7 @@ import org.olat.core.gui.WindowSettings;
 import org.olat.core.gui.Windows;
 import org.olat.core.gui.components.Component;
 import org.olat.core.gui.components.Window;
+import org.olat.core.gui.components.htmlheader.jscss.CustomCSS;
 import org.olat.core.gui.components.velocity.VelocityContainer;
 import org.olat.core.gui.control.Controller;
 import org.olat.core.gui.control.DefaultChiefController;
@@ -244,6 +245,16 @@ public class ExceptionWindowController extends DefaultChiefController {
 	public void removeBodyCssClass(String cssClass) {
 		//
 	}
+	
+	@Override
+	public void addCurrentCustomCSSToView(CustomCSS customCSS) {
+		//
+	}
+
+	@Override
+	public void removeCurrentCustomCSSFromView() {
+		//
+	}
 
 	/**
 	 * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest,
diff --git a/src/main/java/org/olat/course/run/RunMainController.java b/src/main/java/org/olat/course/run/RunMainController.java
index a38c869774974692caed2ead7c8fe210693dae2c..8bb66f851bd11467256fbd72ef33e1878b7d007f 100644
--- a/src/main/java/org/olat/course/run/RunMainController.java
+++ b/src/main/java/org/olat/course/run/RunMainController.java
@@ -42,8 +42,10 @@ import org.olat.core.commons.persistence.PersistenceHelper;
 import org.olat.core.commons.services.mark.Mark;
 import org.olat.core.commons.services.mark.MarkManager;
 import org.olat.core.gui.UserRequest;
+import org.olat.core.gui.Windows;
 import org.olat.core.gui.components.Component;
 import org.olat.core.gui.components.dropdown.Dropdown;
+import org.olat.core.gui.components.htmlheader.jscss.CustomCSS;
 import org.olat.core.gui.components.htmlsite.OlatCmdEvent;
 import org.olat.core.gui.components.link.Link;
 import org.olat.core.gui.components.link.LinkFactory;
@@ -58,6 +60,7 @@ import org.olat.core.gui.components.tree.TreeEvent;
 import org.olat.core.gui.components.tree.TreeModel;
 import org.olat.core.gui.components.tree.TreeNode;
 import org.olat.core.gui.components.velocity.VelocityContainer;
+import org.olat.core.gui.control.ChiefController;
 import org.olat.core.gui.control.ConfigurationChangedListener;
 import org.olat.core.gui.control.Controller;
 import org.olat.core.gui.control.Event;
@@ -504,29 +507,41 @@ public class RunMainController extends MainLayoutBasicController implements Gene
 		
 		if(runLink == source) {
 			toolbarPanel.popUpToRootController(ureq);
+			addCustomCSS(ureq);
 			currentToolCtr = null;
 		} else if(editLink == source) {
 			launchEdit(ureq);
+			removeCustomCSS(ureq);
 		} else if(editSettingsLink == source) {
 			launchEditSettings(ureq);
+			removeCustomCSS(ureq);
 		} else if(userMgmtLink == source) {
 			launchMembersManagement(ureq);
+			removeCustomCSS(ureq);
 		} else if(archiverLink == source) {
 			launchArchive(ureq);
+			removeCustomCSS(ureq);
 		} else if(assessmentLink == source) {
 			launchAssessmentTool(ureq);
+			removeCustomCSS(ureq);
 		} else if(testStatisticLink == source) {
 			launchAssessmentStatistics(ureq, "command.openteststatistic", "TestStatistics", QTIType.test, QTIType.onyx);
+			removeCustomCSS(ureq);
 		} else if (surveyStatisticLink == source) {
 			launchAssessmentStatistics(ureq, "command.opensurveystatistic", "SurveyStatistics", QTIType.survey);
+			removeCustomCSS(ureq);
 		} else if(courseStatisticLink == source) {
 			launchStatistics(ureq);
+			removeCustomCSS(ureq);
 		} else if(dbLink == source) {
 			launchDbs(ureq);
+			removeCustomCSS(ureq);
 		} else if(folderLink == source) {
 			launchCourseFolder(ureq);
+			removeCustomCSS(ureq);
 		} else if(areaLink == source) {
 			launchCourseAreas(ureq);
+			removeCustomCSS(ureq);
 		} else if(efficiencyStatementsLink == source) {
 			launchEfficiencyStatements(ureq);
 		} else if(bookmarkLink == source) {
@@ -535,6 +550,7 @@ public class RunMainController extends MainLayoutBasicController implements Gene
 			launchCalendar(ureq);
 		} else if(detailsLink == source) {
 			launchDetails(ureq);
+			removeCustomCSS(ureq);
 		} else if(noteLink == source) {
 			launchPersonalNotes(ureq);
 		} else if(chatLink == source) {
@@ -572,11 +588,36 @@ public class RunMainController extends MainLayoutBasicController implements Gene
 		}
 	}
 	
+	private void addCustomCSS(UserRequest ureq) {
+		uce = loadUserCourseEnvironment(ureq);
+		CustomCSS customCSS = CourseFactory.getCustomCourseCss(ureq.getUserSession(), uce.getCourseEnvironment());
+		ChiefController cc = Windows.getWindows(ureq).getChiefController();
+		if (cc != null) {
+			if(customCSS == null) {
+				cc.removeCurrentCustomCSSFromView();
+			} else {
+				cc.addCurrentCustomCSSToView(customCSS);
+			}
+		}
+		setCustomCSS(customCSS);
+	}
+	
+	private void removeCustomCSS(UserRequest ureq) {
+		ChiefController cc = Windows.getWindows(ureq).getChiefController();
+		if (cc != null) {
+			cc.removeCurrentCustomCSSFromView();
+		}
+		setCustomCSS(null);
+	}
+	
 	private void eventDone(UserRequest ureq) {
+		// release current node controllers resources and do cleanup
+		removeAsListenerAndDispose(currentToolCtr);
+		currentToolCtr = null;
+		addCustomCSS(ureq);
+		
 		if (isInEditor) {
 			isInEditor = false; // for clarity
-			removeAsListenerAndDispose(currentToolCtr);
-			currentToolCtr = null;
 			if (needsRebuildAfterPublish) {
 				needsRebuildAfterPublish = false;
 				
@@ -593,10 +634,6 @@ public class RunMainController extends MainLayoutBasicController implements Gene
 				// statment)
 				initToolController();
 			}
-		} else {
-			// release current node controllers resources and do cleanup if it was not the editor!
-			removeAsListenerAndDispose(currentToolCtr);
-			currentToolCtr = null;
 		}
 	}
 	
diff --git a/src/main/java/org/olat/shibboleth/MessageWindowController.java b/src/main/java/org/olat/shibboleth/MessageWindowController.java
index 4645bce334cea92c74f88229e0e205b35a343e9f..856c2ed672438d99d6f5a8f3fd1316e5f66b11a3 100644
--- a/src/main/java/org/olat/shibboleth/MessageWindowController.java
+++ b/src/main/java/org/olat/shibboleth/MessageWindowController.java
@@ -33,6 +33,7 @@ import org.olat.core.gui.WindowSettings;
 import org.olat.core.gui.Windows;
 import org.olat.core.gui.components.Component;
 import org.olat.core.gui.components.Window;
+import org.olat.core.gui.components.htmlheader.jscss.CustomCSS;
 import org.olat.core.gui.components.velocity.VelocityContainer;
 import org.olat.core.gui.control.ChiefController;
 import org.olat.core.gui.control.DefaultChiefController;
@@ -103,20 +104,32 @@ public class MessageWindowController extends DefaultChiefController {
 	public void removeBodyCssClass(String cssClass) {
 		//
 	}
+	
+	@Override
+	public void addCurrentCustomCSSToView(CustomCSS customCSS) {
+		//
+	}
+	
+	@Override
+	public void removeCurrentCustomCSSFromView() {
+		//
+	}
 
 	/**
 	 * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest,
 	 *      org.olat.core.gui.components.Component, org.olat.core.gui.control.Event)
 	 */
+	@Override
 	public void event(UserRequest ureq, Component source, Event event) {
-	//
+		//
 	}
 
 	/**
 	 * @see org.olat.core.gui.control.DefaultController#doDispose(boolean)
 	 */
+	@Override
 	protected void doDispose() {
-	//
+		//
 	}
 	
 	/**
@@ -130,5 +143,4 @@ public class MessageWindowController extends DefaultChiefController {
 	public static ChiefController createMessageChiefController(UserRequest ureq, Throwable th, String message, String supportEmail) {
 		return new MessageWindowController(ureq, th, message, supportEmail);
 	}
-
 }
\ No newline at end of file