这是我的 html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<style type="text/css">
input.navbutton
{
text-align: center;
min-width: 100px;
}
</style>
</head>
<body>
<input type="submit" class="navbutton " value="Next" />
</body>
</html>
在 IE 7 上,这最终看起来像这样:
但在 Firefox 上它看起来像这样:
如您所见,文本在 IE 7 中未正确居中。
关于如何解决这个问题有什么想法吗?
最佳答案
按钮上的
min-width
在 IE6/7 中已经不起作用(当文本变大时,它根本不会展开按钮,正如您所期望的那样)。将其替换为 width
并接受它。
关于internet-explorer - CSS 问题 : Combination of "text-align: center" and "min-width" not working in IE 7/IE 8 compat mode,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2236791/