title: C# String Interpolation with HTML Tags - Blazor
body: <p>In the Blazor framework, can one do string interpolation with HTML tags? For example, I want to run a loop that prints a sentence using different colors, but this does not seem to work (since it does not seem the correct approach).</p>
  <pre class="lang-sh prettyprint-override"><code>@page &quot;/HJS&quot;
  &lt;h3&gt;HateJS&lt;/h3&gt;
  
  &lt;div&gt;
      @foreach(string colorX in colors)
      {
          &lt;p style=$&quot;color:{colorX}&quot;&gt;@hateJS&lt;/p&gt;
      }
  &lt;/div&gt;
  
  @code {
      private string hateJS = &quot;I hate JS&quot;;
      private string[] colors = { &quot;blue&quot;, &quot;red&quot; };
  }
  </code></pre>
  <p>If this is not the correct/appropriate approach, then what is it?</p>