jQUery ui buttons some issues in IE7

2019-02-27 17:33发布

I am using jquery UI buttons:

$(document).ready(function() {
    $("a.button, .button, button, input:submit, input:button").button();
})

<p>
    <button type="submit" value="Back">Back</button> &nbsp;&nbsp;<a class="button" id="register">Continue</a>
</p> 

In all browsers the buttons looking perfectly the same , but when i check IE7(switched from IE9 to compatibility mode) the Back button has black border and Continue button moved a couple of pixels down.

here is jsfiddler link http://jsfiddle.net/XJRVt/7/

I also looked at IETester how it is looking in IE6 and it is looking the same like in IE7 :(

May be someone would know how to fix that?

1条回答
我想做一个坏孩纸
2楼-- · 2019-02-27 18:20

Seems like its becasue IE6/IE7 uses a different standard style set for elements. Would proberbly work if you use a CSS Reset or CSS Normalize framework :)

Tried using the Normalize.css (https://github.com/necolas/normalize.css/) and it fixed the float issue atleast.

So its not Jquery UI messing up the layout, its IE!

Try inserting this:

button, input, select, textarea { font-size: 100%; margin: 0; vertical-align: baseline; *vertical-align: middle; }
/*
 * 1. Define line-height as normal to match FF3/4 (set using !important in the UA stylesheet)
 * 2. Correct inner spacing displayed oddly in IE6/7
 */
button, input { line-height: normal; *overflow: visible; }
/*
 * Reintroduce inner spacing in 'table' to avoid overlap and whitespace issues in IE6/7
 */
table button, table input { *overflow: auto; }
查看更多
登录 后发表回答