CSS3PIE with ASP.NET MVC3
I'm trying to get css3pie to work with asp.net mvc, but for some reason it's not working.
I have a view which contains inline css which looks like this:
@{
ViewBag.Title = "Home Page";
}
<div>
<div class="contentWrapper" style="width:开发者_JS百科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>
}
I've tried placing the PIE.htc file in the root directory of my project, the views directory, and many other places but it doesn't look like it's working in IE8 and below. Where exactly should the htc file go and how am i to reference it correctly through both inline css and and external stylesheet?
Thanks
I got it. Add it to the Content folder with your CSS file then for the behavior in the CSS file do:
behavior: url('../../Content/PIE.htc');
It worked for me anyway.
精彩评论