title: Displaying List elements in Razor view
body: <p>I am passing a list to the view from Controller. How can i generate the following type of HTML by using the Model passed....... 
  <img src="https://i.stack.imgur.com/z1pNX.jpg" alt="enter image description here">.</p>
  
  <p>I tried using the following code, but it generates a vertical list whereas i want it to be horizontal as well as vertical. Here's my code. How will you write your's to achieve an output like above</p>
  
  <pre><code>@foreach (var cats in Model)
  {
      &lt;li&gt;@cats.CategoryName&lt;/li&gt;
  }
  </code></pre>