CSS将元素保持在“固定"状态屏幕上的位置 [英] CSS to keep element at "fixed" position on screen

查看:122
本文介绍了CSS将元素保持在“固定"状态屏幕上的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种使用CSS在浏览器屏幕上创建固定" HTML对象的技巧.我希望它始终保持在同一位置,即使用户在文档中滚动时也是如此.我不确定这是什么合适的术语.

I'm looking for a trick to create a "fixed" HTML object on the browser screen using CSS. I want it to stay in the same position all the time, even when the user scrolls through the document. I'm not sure what the proper term for this is.

就像整个页面上跟随您的Facebook上的聊天按钮或某些网站上的反馈"按钮一样.

It would be like the chat button on Facebook or the Feedback button that is on some websites that follows you throughout the page.

在我的情况下,我想始终在屏幕的右下角绝对保留一个div.样本CSS表示赞赏.

In my situation, I want to keep a div at the absolute bottom-right corner of the screen at all times. Sample CSS appreciated.

推荐答案

您可能正在寻找 位置:固定.

You may be looking for position: fixed.

除IE6和许多移动设备外,其他任何地方都可以使用.

Works everywhere except IE6 and many mobile devices.

这篇关于CSS将元素保持在“固定"状态屏幕上的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆