Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scrolling element contents without javascript

Tags:

css

xhtml

Dear all, is there a way to scroll, as in relatively shift the contents of, an element without using javascript, and only using CSS?

If that matters, the element in question has overflow:hidden and white-space: nowrap to make it 'hide' some parts of its content. The element is normally scrollable with javascript, but needs to be properly shifted upon initial rendering (and without further interactive scrolling, of course) in case javascript is disabled.

like image 590
Dennis Kreminsky Avatar asked Mar 06 '26 04:03

Dennis Kreminsky


1 Answers

No, there is no way to scroll items on a page (unless it's an iframe with the hash portion of the url included, in which case the browser will control the initial positioning of the scroll, not css or html) using only CSS and HTML.

like image 158
Jamie Dixon Avatar answered Mar 07 '26 17:03

Jamie Dixon