title: MVC, Razor, CSS and Dynamic Div ids
body: <p>I'm running into an issue with MVC the CSS for the objects and handling it it with the id's based on the name.</p>
  
  <p>What i have is </p>
  
  <pre><code>@foreach (var item in Model)
          {
          &lt;div class="row d-flex"&gt;
              &lt;div class="col my-0 my-md-5 position-relative category-container p-0 p-sm-3 d-inline-block"&gt;
                  &lt;div id^=@item.Description class="category mx-auto"&gt;
                      @Html.ActionLink(@item.Description], "LoadById", new { id = item.Id })
  
                  &lt;/div&gt;
  
               &lt;/div&gt;
           &lt;/div&gt;
  
      }
  </code></pre>
  
  <p>The CSS is set to reference the text the "id" should have, IE Desktops, Laptops, etc.
  I've created a string[] and assigned it to the item.Description as well
  then tried referencing  the string name a[0] in the css, but it doesn't see that either.
  Is there a way to have the CSS find the ID variables to have the formatting handled properly?</p>
  
  <p>the CSS I have/Tried is </p>
  
  <pre><code> #dashboard #Desktops {
      background-image: url("../images/dashboardImages/real/desktops.jpg");
  }
   #dashboard #a[0] {
      background-image: url("../images/dashboardImages/real/desktops.jpg");
  }
  </code></pre>