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" />
<![endif]-->
</umbraco:Macro>



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" />
</umbraco:Macro>





Comments

Popular posts from this blog

Umbraco - Reset the Admin Password via SQL Server

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

Umbraco Macro for IFrame when Embedding Video, Vimeo Universal Player, or other types of IFrame on to a Page XSLT version and Razor Version