【问题标题】:Background image is not working after deploying MVC4 application it in IIS [duplicate]在IIS中部署MVC4应用程序后背景图像不起作用[重复]
【发布时间】:2015-05-15 20:14:08
【问题描述】:

我有一个用 MVC4 开发的网站,一切正常,直到我在 iis 中部署它。部署后背景图像根本没有加载

<style>
        .testt {
            background-image: url("../../Images/master/background-Mid.bmp");
            width: 100%;
            height: 100px;
        }
    </style>

</head>
<body>    
 <header style="position: relative; top: -20px ">
     <div class="testt">

        <div style="float:right;width:20%;margin-right:10%"><img src="~/Images/master/Right.bmp" /></div>
        <div style="float:right;width:5%"> <img src="~/Images/master/tstLogo.gif"/></div>
      <div style="float:left;width:5%"> <img src="~/Images/master/Left.bmp" /></div>
         </div>

        </header>

这里的背景图片background-Mid.bmp在iis中部署后没有出现

【问题讨论】:

  • 我不知道这里出了什么问题。路径 ../ 在 IIS 中不起作用
  • 你有console errors吗?

标签: css .net html asp.net-mvc-4


【解决方案1】:

我终于找到了解决方案@Url.Content(~path to image) 将解决各种问题

【讨论】:

    猜你喜欢
    • 2017-09-13
    • 1970-01-01
    • 2017-04-29
    • 2018-03-22
    • 1970-01-01
    • 1970-01-01
    • 2018-02-20
    • 1970-01-01
    • 2018-03-25
    相关资源
    最近更新 更多