CSS Not Working in MVC4 razor view

Total Post:4

 973  View(s)
Rate this:

Hi Expert,

I Used CSS File in my razor view and use its class in my code. But It's not working and my layout is not up to the mark.

Here is my code,

<link src="@Url.Content("~/Content/font-awesome.min.css")" rel="stylesheet"/>
<div class="col-md-4 header-navigation-col">

               <li><a href="index.html">Astro Trainers</a></li>
               <li><a href="index.html">Basketball Shoes</a></li>
               <li><a href="index.html">Boots</a></li>
               <li><a href="index.html">Canvas Shoes</a></li>
               <li><a href="index.html">Football Boots</a></li>
               <li><a href="index.html">Golf Shoes</a></li>
               <li><a href="index.html">Hi Tops</a></li>
               <li><a href="index.html">Indoor Trainers</a></li>

Please give me some solution to accomplish my task.

Thank you!!!

  1. Post:44

    Re: CSS Not Working in MVC4 razor view

    Hi Shaan,

    After analyzing your code, I reached the solution, that you can use src instead of href.

    Please follow the below line of code to accomplish your task.

    <link href="@Url.Content("~/Content/font-awesome.min.css")" rel="stylesheet"/>

    I think it's informative for you...