MVC cannot display image using background-url in css - uses bundling

前端 未结 4 514
花落未央
花落未央 2020-12-20 22:07

I have an MVC4 project which has the following structure:

/Content/css/sprites/topbar.css

/Content/images/topbar.png

In the c

4条回答
  •  攒了一身酷
    2020-12-20 22:58

    Try using:

    .social ul li a.blog { background: url(@Url.Content("~/Content/img/houseIcon.png")) no-repeat left top; }
    

    For using razor in CSS, see this http://www.codeproject.com/Articles/171695/Dynamic-CSS-using-Razor-Engine

提交回复
热议问题