0

I dont know how to phrase this question correctly, I would like to create something like the logo on the upper right corner of this website: http://www.afterthecircle.com/

When the user scrolls down, the logo moves with the scrolling movement and always stays visible to the user.

Any suggestions?

Dominic L.
  • 55
  • 1
  • 5

3 Answers3

2

Use position: fixed along with top or bottom and left or right:

.logo {
    position: fixed;
    bottom: 1em;
    right: 1em;
}
Fenton
  • 224,347
  • 65
  • 373
  • 385
2

As brbcoding said, you are looking for the CSS property position with the value fixed. With the properties top, bottom, left, and right, you can then position the element. An example:

CSS

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

HTML

<div class=fixedElement>Hey!</div>
Aart Stuurman
  • 2,714
  • 4
  • 19
  • 42
1

Fixed positioning will allow you to scroll and keep an item in it's original position.

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

DEMO

brbcoding
  • 12,810
  • 2
  • 35
  • 51