Twitter bootstrap glyphicons do not appear in release mode 404

前端 未结 7 1988
慢半拍i
慢半拍i 2020-12-24 11:55

I`m working on a project in ASP.NET MVC 4 and I did following steps:

  1. Downloaded twitter bootstrap from http://blog.getbootstrap.com/2013/12/05/bootstrap-3-

7条回答
  •  眼角桃花
    2020-12-24 12:25

    Here's how I solved it -- I'm using MVC5 and Bootstrap 3.1.1.

    I have my files organized in the project like this:

    /Content/Bootstrap/bootstrap.css
                       bootstrap.min.css
    /Content/fonts/glyphicons-halflings-regular.eot
                   glyphicons-halflings-regular.svg
                   glyphicons-halflings-regular.ttf
                   glyphicons-halflings-regular.woff
    

    Then I added another level to my virtual path in the bundle config

    bundles.Add(new StyleBundle("~/Content/site/css").Include(
        "~/Content/bootstrap/bootstrap.css",
        "~/Content/styles/site.css"
    ));
    

    Previously I had used ~/Content/css

    And in the view...

    @Styles.Render("~/Content/site/css")
    

    This worked but I still got a 404 on one of the fonts... so I added Giles' solution.

    
    
        
            
            
            
            
            
            
            
            
            
        
    
    

提交回复
热议问题