输入文本在 Chrome、FF、Opera 中为粗体,但在 IE6.0 中不是粗体。为什么?

发布于 2025-01-01 11:09:22 字数 683 浏览 3 评论 0原文

我删除了很多文本、按钮等,因此这个 html 页面看起来很简化。我还是不明白,为什么IE6.0不显示“IE6.0中不加粗。为什么?”的文字。大胆吗? 谢谢。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Test</title>
<style>
input[type='text'], input[type='password'], input[type='button'], input[type='submit'], input[type='file'], textarea {
    font-size:16px;
    font-weight:bold;
}
</style>
</head>
<body>
<input style="font-size:16px; font-weight:bold;" value="bold" type="text"> 
<input type="text" value="not bold in IE6.0. Why?">
</body></html>

I removed a lot of text, buttons etc, so this html page looks simplified. I still don't understand, why IE6.0 doesn't display the text "not bold in IE6.0. Why?" as bold?
Thank you.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Test</title>
<style>
input[type='text'], input[type='password'], input[type='button'], input[type='submit'], input[type='file'], textarea {
    font-size:16px;
    font-weight:bold;
}
</style>
</head>
<body>
<input style="font-size:16px; font-weight:bold;" value="bold" type="text"> 
<input type="text" value="not bold in IE6.0. Why?">
</body></html>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

那支青花 2025-01-08 11:09:22

IE6 不支持属性选择器。

/* So, this would work in IE6: */
input { font-weight: bold; }

/* But IE6 won’t understand this: */
input[type="text"] { font-weight: bold; }

/* If you combine the two, IE6 still won’t understand it!
   It will drop the entire rule set, and it won’t apply any of its styles.
 */
input, input[type="text"] { font-weight: bold; }

IE6 doesn’t support attribute selectors.

/* So, this would work in IE6: */
input { font-weight: bold; }

/* But IE6 won’t understand this: */
input[type="text"] { font-weight: bold; }

/* If you combine the two, IE6 still won’t understand it!
   It will drop the entire rule set, and it won’t apply any of its styles.
 */
input, input[type="text"] { font-weight: bold; }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文