【问题标题】:Jeditable button styling problem可编辑按钮样式问题
【发布时间】:2011-02-02 22:06:42
【问题描述】:

我在 IE8 中设置提交和取消按钮的样式时遇到问题。
使用:

.editableTable button[type="submit"]
{
    background:url("../images/Ok-icon.png") no-repeat 0 0;
    border:none;
}

.editableTable button[type="cancel"],.editableTable button[type="button"]
{
    background:url("../images/Close-icon.png") no-repeat 0 0;    
    border:none;
}

我在 FF 和 IE7 中得到了我想要的,但在 IE8 中,按钮类型在确定和取消按钮上都是提交,所以我在两个按钮上都得到了确定图标。我的另一个选择是 button:nth-child() 但这在 IE 中不起作用。所以我被困住了,真的很感激任何指点......

谢谢!

问候斯文

【问题讨论】:

  • 我把你的问题读成“Jedi Table”:)
  • 愿原力与你同在... :)

标签: css internet-explorer button jeditable


【解决方案1】:

您可能缺少Doctype 声明。尝试在<html> 开始之前在页面顶部添加<!doctype html>,看看会发生什么。还有一个怪癖,IE 有时不理解type="submit",但理解type="Submit",反之亦然。也试试这些。

此外,类似的问题已在 SO 上被问过几次。

其中一个在这里 Css attribute selector for input type="button" not working on IE7

--编辑

哦。还发现了这个关于 IE8 中选择器问题的问题。 Attribute selectors, JavaScript and IE8

【讨论】:

  • 我在 Masterpage 中有这个声明:ttp://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" rel="nofollow" target="_blank">w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> w3.org/1999/xhtml ">
  • @Zwempha,嗯。您是否尝试过其他 SO 问题中的答案?由于这个原因,通常我会尽量远离 CSS 中的属性 seelctor。如果可以的话,我强烈推荐使用类,这样效果会好很多。
猜你喜欢
  • 1970-01-01
  • 2019-02-12
  • 2014-10-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-12-15
  • 2011-02-10
  • 2020-11-19
相关资源
最近更新 更多