用户滚动时向下滚动的图像/徽标?

时间:2013-07-01 20:19:28

标签: html css image scroll

我不知道如何正确地表达这个问题,我想在本网站的右上角创建类似徽标的内容:http://www.afterthecircle.com/

当用户向下滚动时,徽标会随着滚动动作而移动,并始终对用户可见。

有什么建议吗?

3 个答案:

答案 0 :(得分:2)

使用position: fixed以及顶部或底部以及左侧或右侧:

.logo {
    position: fixed;
    bottom: 1em;
    right: 1em;
}

答案 1 :(得分:2)

正如brbcoding所说,你正在寻找固定值的CSS属性位置。使用顶部,底部,左侧和右侧属性,您可以定位元素。一个例子:

CSS

.fixedElement {
    position: fixed;
    top: 100px;
    left: 100px;
}

HTML

<div class=fixedElement>Hey!</div>

答案 2 :(得分:1)

Fixed positioning将允许您滚动并保留项目的原始位置。

#fixed-thing {
    position: fixed;
    top: 0;
    right: 0;
}

<强> DEMO

相关问题