jquery ui按钮图标在firefox中不居中

标签 jquery jquery-ui button icons

我有这个按钮

$('#galery .buttonClose').button({
    icons: {
        primary: "ui-icon-closethick",
        text: false
    }
});

CSS:

  #galery .buttonClose{position: absolute; top: 3px; right: 3px; height: 30px; width: 30px;}

在 Chrome 上工作正常,图标位于按钮中央,但在 Firefox 中,图标完全向下

jsFiddle: http://jsfiddle.net/nDMV8/2/

这似乎是 jQuery UI 中的一个常见错误,我认为当您尝试执行一个没有文本的按钮以正确设置 css 并在所有浏览器中工作时,他们应该计划一些事情。就像他们在主题页面(底部)上显示所有图标一样:http://jqueryui.com/themeroller/

最佳答案

#galery .buttonClose{
    top: 3px;
    right:3px;
    height: auto;
    padding-top:5px;
    padding-bottom:5px;
    width: 35px;
}

示例 here 。在 chrome、ff 和 ie 中测试。 ​

enter image description here

关于jquery ui按钮图标在firefox中不居中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9910879/

相关文章:

css - jquery ui draggable + sortable helper 样式

html - Twitter 和 Facebook 按钮对齐

asp.net-mvc - jQuery.Load() 不触发 ASP.NET MVC2 中的 Request.IsAjaxRequest

javascript - 如何滚动到动态添加的最后一个div?

javascript - 达到宽度<480 px时如何设置平滑滚动偏移

jquery .html(...) 改变不变?

Asp.net 如何在 ListView 中添加链接按钮并进行一些编程

ios - 点击后如何禁用按钮几秒钟

javascript - jQuery :nth-of-type acting quirky

jquery - 传递 3 个字符长度后不会淡出错误消息