html固定位置IE问题

发布于 12-20 23:45 字数 240 浏览 2 评论 0原文

我的页面右下角有一个聊天按钮/链接。这是我在 css 中的代码,它在 firefox 和 chrome 中完美运行:

a.trigger{
position: fixed;
bottom: 0px; right: 15px;
padding: 6px 10px 6px 10px;
display: block;
}

但在 IE 中,它只是位于页面顶部。我该如何修复它以便它也可以在 IE 中运行?

I have a chat button/link that sits at the bottom right of my page. This is my code in the css, it works perfect in firefox and chrome:

a.trigger{
position: fixed;
bottom: 0px; right: 15px;
padding: 6px 10px 6px 10px;
display: block;
}

In IE though, it just sits at the top of the page. How can I fix it so it works in IE too?

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

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

发布评论

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

评论(2

じее2024-12-27 23:45:32

注意:仅当指定 !DOCTYPE 时,IE7、IE8 和 IE9 才支持固定值。

页面的第一行应为以下内容之一:

HTML 4

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

HTML 5

<!DOCTYPE html>

来源: http://www .w3schools.com/css/css_positioning.asp

Note: IE7, IE8 and IE9 support the fixed value only if a !DOCTYPE is specified.

The first line of your page should one of the following:

HTML 4

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

HTML 5

<!DOCTYPE html>

Source: http://www.w3schools.com/css/css_positioning.asp

寄居者2024-12-27 23:45:32

下面的代码是让 IE 表现得更好一点的巧妙方法。确保 css 是按这个顺序排列的,这应该就是答案,或者至少让你更接近你的目标。

* html .sticky {
  position:absolute;
}

.sticky {
  position:fixed;
  right:0;
  top:40%;
}

The following code is a clever way to make IE behave a little better. Make sure the css is in that order and that should be the answer or at least get you closer to your goal.

* html .sticky {
  position:absolute;
}

.sticky {
  position:fixed;
  right:0;
  top:40%;
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文