导入CSS3Pie时,我收到以下错误.
Uncaught TypeError: Object [object DOMWindow] has no method 'attachEvent'
Run Code Online (Sandbox Code Playgroud)
我正在使用Chrome.这可能是我造成的,或者只是一个错误.谢谢!
n个计数器是否在:nth-of-type()CSS选择器中相互独立递增?例如,如果我想要label:checked:nth-of-type(3)以匹配其一般兄弟文章:nth-of-type(3),这项技术应该有效吗?(它没有,但也许我只是想确定.)
label:checked:nth-of-type(n) ~ article:nth-of-type(n)
Run Code Online (Sandbox Code Playgroud)
这个想法不必明确地说:nth-of-type(1),:nth-of-type(2),依此类推.
我正在尝试应用css3pie
到我的网站,它似乎根本没有应用.我尝试过任何我能找到的东西:
position:relative;
z-index: 0;,不好.我试图申请的代码是:
-webkit-box-shadow: 0px 0px 13px rgba(0,0,0,.9);
-moz-box-shadow: 0px 0px 13px rgba(0,0,0,.9);
box-shadow: 0px 0px 13px rgba(0,0,0,.9);
Run Code Online (Sandbox Code Playgroud)
我错过了什么?
编辑: 如果这很重要,当我在IE中查看加载的CSS时,我看到行为命令与下一行相同,尽管语法是正确的
为了在IE 6/7/8上获得CSS3效果(border-radius,box-shadow ...),我正在使用css3pie.
但是,css3pie会css3-container (v1) / css3pie (v2)在DOM中生成一些标记,这会使预期的体系结构失调.这是一个例子:
CSS
pre {
border: 1px solid #aaa;
border-radius: 5px;
behavior: url(pie.htc);
}
Run Code Online (Sandbox Code Playgroud)
HTML
<div class="foo">bar</div>
<p class="getme">paragraph</p>
<pre>preformatted</pre>
Run Code Online (Sandbox Code Playgroud)
jQuery的
// undefined expected: getme
alert($("pre").prev().attr("class"));
// css3-container expected: p
alert($("pre").prev()[0].tagName);
// getme expected: foo
alert($("pre").prev().prev().attr("class"));
// 4 expected: 3
alert($("body").children().size());
// will not set expected: Impact
$("p+pre").css({fontFamily: "Impact"});
// it almost affects all such jQuery selctors
Run Code Online (Sandbox Code Playgroud)
实际生成的源是这样的:
<DIV class="foo">bar</DIV>
<P class="paragraph">paragraph</P>
<css3-container...>
<border...>
<shape...><stroke></stroke><stroke></stroke></shape>
</border>
</css3-container>
<PRE>preformatted</PRE>
Run Code Online (Sandbox Code Playgroud)
有谁遇到过这种问题?任何解决方法?有没有css3pie的替代方案让CSS3在IE 6/7/8上运行?
我注意到用CSS喜欢
body {
background: #f00;
}
div {
background: rgba(255,255,255,0.4);
-pie-background: rgba(255,255,255,0.4);
-moz-box-shadow: 0 0 10px rgba(0,0,0,0.4);
-webkit-box-shadow: 0 0 10px rgba(0,0,0,0.4);
box-shadow: 0 0 10px rgba(0,0,0,0.4);
padding: 50px;
behavior: url(PIE.htc);
}
Run Code Online (Sandbox Code Playgroud)
我将在FireFox和IE/PIE中获得以下内容

有可能解决这个问题吗?通过rgba背景显示的框阴影?
我有一个CSS文件使用CSS3PIE行为脚本,所以IE8将支持我的文件,但是,我想知道是否有任何方法来制作相对于CSS文件而不是相对于HTML文件的行为URL.有没有办法做到这一点?
要应用于behavior: url(PIE.htc);项目接缝中的所有css文件是非常长的故事和每个新版本我需要再次重复它.
有什么jquery ui CSS3Pie版本我可以在某处找到?
要么
是否可以在单独的css文件中添加CSS3Pie支持,因此在这种情况下,可以将该css用于任何新的jquery ui版本.
我试图在我的自定义css中为jquery UI做这样的修复:
.ui-corner-top, .ui-corner-left, .ui-corner-right, .ui-corner-bottom { behavior: url("PIE.htc"); }
.ui-corner-all, .ui-corner-tl, .ui-corner-tr, .ui-corner-bl, .ui-corner-br { behavior: url("PIE.htc"); }
Run Code Online (Sandbox Code Playgroud)
但它没有用.
同时这样的修复工作我的样式,例如,如果有风格
.mystyle
{
border-radius: 8px;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border: solid 2px #36405c;
}
Run Code Online (Sandbox Code Playgroud)
我可以定义它,它将工作:
.mystyle
{
behavior: url("PIE.htc"); /*it will be working*/
}
Run Code Online (Sandbox Code Playgroud)
所以我假设它不起作用,jquery UI因为jquery UI有多个地方.ui-corner-*声明具有不同的半径.
无论如何,有可能做到这一点吗?
有人的想法吗?
更新 这似乎是backgroundIE8中的一个问题.CSS3 PIE似乎正常工作,但是当我有背景时它没有显示.如果我完全删除背景css,它会再次显示.IE:
html, body{
background: /*CSS */; /* Remove this property */
}
Run Code Online (Sandbox Code Playgroud)
现在的问题变成了我如何才能CSS3 PIE正确的IE 8的工作有一个背景是什么?
我试图使用CSS3 Pie JS Edition在IE 8中复制一下.这是我想要的样子:

以下是使用CSS3 PIE在IE 8中的显示方式:

正如你所看到的,当我实现CSS3 PIE时,盒子就会消失!我之前没有使用过CSS3 PIE,也不知道出了什么问题.这是我正在使用的代码:
注意:我使用的是JS版(我使用的是托管的CMS,没有服务器端访问权限,因此无法使用该.htc文件.)
这是我调用CSS3 Pie的代码:
<!--[if lt IE 10]>
<script type="text/javascript" src="/js/PIE.js"></script>
<script type="text/javascript">
$(function() {
if (window.PIE) {
$('.surround').each(function() {
PIE.attach(this);
});
}
});
</script>
<![endif]-->
Run Code Online (Sandbox Code Playgroud)
这是HTML和CSS:
<div class="row surround">
<div class="twelvecol">
<p>Lorem Ipsum</p>
</div>
</div>
.surround
{
-webkit-box-sizing: …Run Code Online (Sandbox Code Playgroud) 我正在使用CSS3Pie在IE中制作使用无效CSS属性的圆角
behavior: url(/PIE.htc);
Run Code Online (Sandbox Code Playgroud)
如果我在我的主CSS中保留这个声明,其他浏览器会加载这个.htc文件,即使他们不需要这个或只有IE会加载这个文件?
behavior: url(/PIE.htc);在性能方面,保持单独的IE条件样式表是否有任何好处?
<!--[if lt IE 9]>
<link rel="stylesheet" type="text/css" href="ie8-and-down.css" />
<![endif]-->
Run Code Online (Sandbox Code Playgroud)
整个代码是这样的
border: 1px solid #696;
padding: 60px 0;
text-align: center; width: 200px;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: 8px;
background: #EEFF99;
behavior: url(/PIE.htc);
Run Code Online (Sandbox Code Playgroud)