• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1225
  • Last Modified:

Set Scroll Position to Bottom Of Element


I have a <span> element with height, width and overflow attributes set. As i press a button javascript adds to the text written inside, eventually overflowing the element and causing scroll bars to appear. Is there a way to automatically locate the user at the bottom of the element, meaning they don't need to scroll down themselves.

1 Solution
Hey Richard,

You can't do this in CSS, you'll be needing to use javascript to provide that functionallity for you.

check out scrollTop and scrollLeft, if I remember correctly these have setters too, that in combination with innerHeight or some other property like it should get you what you want.

Good luck,


Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now