Umbraco Inline Razor to refer to Stylesheets within a Template

Umbraco Inline Razor to refer to a Stylesheet Example: 

<umbraco:Macro runat="server" language="cshtml">
@{var myStyleSheet = "~/css/styles.css";}
<link rel="stylesheet"  href="@Href(myStyleSheet)" type="text/css" media="screen" />

@{var IEStyleSheet = "~/css/stylesIE.css";}
<!--[if lte IE 8]>
<link rel="stylesheet" href="@Href(myStyleSheet)" type="text/css" media="screen" />

Umbraco Inline Razor to refer to lots of Stylesheets, using the folder as the reference Example

<umbraco:Macro runat="server" language="cshtml">
@{var myStyleSheetFolder = "~/css/";}
<link href="@Href(myStyleSheetFolder)bootstrap.css" rel="stylesheet">
      <link rel="stylesheet" type="text/css" href="@Href(myStyleSheetFolder)theme.css">
    <link rel="stylesheet" href="@Href(myStyleSheetFolder)index.css" type="text/css" media="screen" />


Popular posts from this blog

Umbraco 7 - C# Razor - Passing a parameter variable from a Template to a Partial View.

Umbraco 7 Hide a page from Navigation or Sub Navigation with umbracoNaviHide using Razor in a template or partial view

Umbraco Razor Sort Nodes Ascending or Descending