简体   繁体   English

使用CSS3 PIE设置输入[type = submit]样式时IE8崩溃

[英]IE8 crashes when styling input[type=submit] with CSS3 PIE

Sometimes the page works and you need to refresh the page to see it crash. 有时页面有效,您需要刷新页面才能看到它崩溃。

You can see a live sample here: http://rcnhca.org.uk/sites/first_steps/account/ (ie7 works fine, I am not supporting ie6) 你可以在这里看到一个实时样本: http ://rcnhca.org.uk/sites/first_steps/account/(ie7工作正常,我不支持ie6)

I am attempting to style my submit button with the following values: 我正在尝试使用以下值设置提交按钮的样式:

a.button, input.button {
    border: 2px solid #3A90A7;
    border-radius: 5px 5px 5px 5px;
    color: #202D32;
    display: block;
    float: left;
    height: 2.6em;
    line-height: 2.6em;
    margin: 0.667em 0.333em;
    padding: 0 1em;
    position: relative;
    text-decoration: none;
}

a.button:hover, input.button:hover{
    border: #202d32 solid 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 0 3px #FFFFFF inset;
    -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 0 3px #FFFFFF inset;
}

input[type=submit] {
    behavior: url(http://rcnhca.org.uk/sites/first_steps/PIE.htc);
    position: relative;
    -pie-poll:true;
}

a.button:hover, input.button:hover{
    -pie-box-shadow: none;
}

.button {
    -pie-background: linear-gradient(top, #ffffff 0%,#e5e5e5 100%);
}

.button.active {
    -pie-background: linear-gradient(top, #b7b7b7 0%,#b7b7b7 8%,#e5e5e5 8%,#ffffff 100%);
}

Finally, the submit button in all it's glory: 最后,提交按钮的所有荣耀:

<input id="submitbtn" class="button omega" type="submit" value="Create your account" name="submit">

Does anyone know what could be causing this crash? 有谁知道导致这次崩溃的原因是什么? I don't get any information apart from a script is causing the page to run slowly. 除了脚本之外我没有得到任何信息导致页面运行缓慢。

I had the same problem and I discovered that my button did not work in IE8 beacuse I needed one of the borders to be none and this crashed my CSS3PIE. 我有同样的问题,我发现我的按钮在IE8中不起作用,因为我需要其中一个边框是none ,这使我的CSS3PIE崩溃了。 I changed from border-left: none; 我改变了border-left: none; to border-left-width: 0; border-left-width: 0; and it worked. 它起作用了。

I am gonna check and test but first you need to know some stuff about CSS3PIE 我要检查和测试,但首先你需要了解一些关于CSS3PIE的东西

CSS3PIE uses VML -vector markup language- that allows you to draw graphics using Javascript, and it includes functions to create popular CSS3 like effects but limited. CSS3PIE使用VML -vector标记语言 - 允许您使用Javascript绘制图形,它包含创建流行的CSS3效果但功能有限的功能。

Because it uses Javascript to draw the graphics, It utilize a lot of the browser resources and cause it to hang and eventually crash. 因为它使用Javascript来绘制图形,它利用了大量的浏览器资源并导致它挂起并最终崩溃。

I was using CSS3PIE before but I dropped it after reading this impressive analogy by Paul Irish . 之前我使用的是CSS3PIE,但在阅读了Paul Irish的这个令人印象深刻的类比之后,我放弃了它。 You should focus on adapting your design to gracefully degrade on IE. 您应该专注于调整您的设计以优雅降级IE。 It would be better if you used something like Modernizr to check for the missing features in the browser and add specific styling to it. 如果您使用Modernizr之类的东西检查浏览器中缺少的功能并为其添加特定样式,那会更好。

Will be back after testing 测试后会回来

Update 更新

I tested in IE8 and yes it crashes. 我在IE8中测试过,是的,它崩溃了。 There's nothing you can go for I think :( 你觉得没什么可以去的:(

I would recommend you fallback for a solid light grey color or use a background gradient image. 我建议您使用实心浅灰色或使用背景渐变图像。

With some more testing I found the answer to this problem, it wasn't the fact that it was submit button but that it was some kind of form button and I gave it font-size . 通过一些更多的测试,我找到了这个问题的答案,这不是事实,它是提交按钮,但它是某种形式按钮,我给它的font-size

If I remove the font-size property on the element then IE8 stops crashing and I'm a happy bunny. 如果我删除元素上的font-size属性,那么IE8会停止崩溃,我是一个快乐的兔子。

Apologies as I didn't include the part of the CSS which had the font-size (It's a big file, I glazed over it). 道歉,因为我没有包含具有字体大小的CSS部分(这是一个大文件,我给它上釉)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM