0

Can I get a fixed block element to scroll horizontally without JavaScript or jQuery wizardry? The block after it reaches the top of the viewport has its CSS position changed from absolute to fixed when the window is scrolled vertically. Is it necessary to construct another set of calculations to determine how to position it when scrolling the page horizontally?

Stack Overflow does this too. enter image description here

Adam S
  • 509
  • 10
  • 24

2 Answers2

1

Not possible with pure css.

You will need Javascript.. (i am facing the same problem right now..)

See Centering a fixed element, but scroll it horizontally

Community
  • 1
  • 1
Gabriele Petrioli
  • 191,379
  • 34
  • 261
  • 317
0

I don't really get your question but somehow I think this is what your are looking for: Use CSS @media queries to determine the width of the viewport.

Adrian World
  • 3,118
  • 2
  • 16
  • 25