1

我试图让 css3pie 与 asp.net mvc 一起工作,但由于某种原因它不起作用。

我有一个包含内联 css 的视图,如下所示:

@{
    ViewBag.Title = "Home Page";
}

<div>


    <div class="contentWrapper" style="width:600px;margin:25px auto;">
        Hello World
        <input name="button" value="Button" class="button" type="button" />
    </div>
</div>


@section BreadCrumb {
    <div class="breadcrumb">
    </div>
    <div class="pageTitle">
        <h1></h1>
    </div>
} 

@section HeaderContent {

<style type="text/css"> 

    .contentWrapper  
    {
        border: 1px solid #ddd; 
        padding: 30px 40px 20px 40px; 
        background: #fff;
        /* -- CSS3 - define rounded corners for the form -- */  
        -webkit-border-radius: 10px;
        -moz-border-radius: 10px;
        border-radius: 10px;        

        /* -- CSS3 - create a background graident -- */

        background: -webkit-gradient(linear, 0% 0%, 0% 40%, from(#EEE), to(#FFFFFF)); 
        background: -moz-linear-gradient(0% 40% 90deg,#FFF, #EEE); 
         -pie-background: linear-gradient(#FFF, #EEE); 


        -webkit-box-shadow:0px 0 50px #ccc;
        -moz-box-shadow:0px 0 50px #ccc; 
        box-shadow:0px 0 50px #ccc;     

        behavior: url(PIE.htc);
    }   


    </style> 

}

我已经尝试将 PIE.htc 文件放在我的项目的根目录、views 目录和许多其他地方,但它看起来不像在 IE8 及以下版本中工作。htc 文件到底应该放在哪里,我如何通过内联 css 和外部样式表正确引用它?

谢谢

4

1 回答 1

5

我知道了。将其与您的 CSS 文件一起添加到 Content 文件夹,然后针对 CSS 文件中的行为执行以下操作:

behavior: url('../../Content/PIE.htc');

无论如何,它对我有用。

于 2011-08-05T16:24:25.690 回答