CSS Not Working in MVC4 razor view

Total Post:4

Points:28
C#
 810  View(s)
Ratings:
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">

          <h4>Footwear</h4>
          <ul>
               <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>
          </ul>
</div>

Please give me some solution to accomplish my task.

Thank you!!!

  1. Post:44

    Points:310
    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...

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!