title: Render styles or link element in .net core C# code
body: <p>I have a method in a .net core API that uses a HTMl to PDF conversion Nuget package to create PDF files from a HTML string. To produce the PDF I simply create a string of html and pass it into a method in the conversion library.</p>
  
  <p>In .net 4.5 I could include CSS files in this HTMl string by doing this (where the variable "html" is the input to display):</p>
  
  <pre><code>htmlToConvert = "&lt;html class='mdzr--svg'&gt;&lt;head&gt;" +                            
      HttpUtility.HtmlDecode(Styles.Render("~/Content/css").ToHtmlString()) +
      "&lt;/head&gt;&lt;body&gt;" + html +
      "&lt;/body&gt;&lt;/html&gt;";
  </code></pre>
  
  <p>I am now trying to do a similar thing in .net core but am struggling with how to render a CSS file as there isn't the same Styles.Render functionality.</p>
  
  <p>I am planning on putting the CSS file somewhere in the wwwroot of the API.</p>
  
  <p>Any advice on how to access it and render it into a link element would be awesome.</p>
  
  <p>Thanks!</p>