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 Razor Sort Nodes Ascending or Descending

Umbraco Razor get Querystring

Create a .NET Contact Form that Gets the Last Url Visited in C# Can also be Used in Umbraco