Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7402983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:55:57+00:00 2026-05-29T04:55:57+00:00

Suppose I have the following html: <div style=width:200px;height:200px;overflow:scroll> … </div> If the stuff in

  • 0

Suppose I have the following html:

<div style="width:200px;height:200px;overflow:scroll">
  ...
</div>

If the stuff in this div ends up overflowing, the most popular way to change the scrolling position of this item is to use jQuery.scrollTop(). However, I have a situation where I would like to set the initial scroll position of the div using the source HTML. Is there a way of doing this? All examples I see online for doing this end up using javascript.

One way I tried is to write a scrollTop property on the element, like so:

<div scrollTop=20 style="width:200px;height:200px;overflow:scroll">
  ...
</div>

However, this does not work. Surely, there must be a way to set the initial scrolling position of an overflowing item via HTML/CSS…

Here is a full version of this code that illustrates that it doesn’t work- The vertical scrollbar remains at “0”: http://jsfiddle.net/gueBZ/1/

Can anyone help me to make it work? Thanks so much for any pointers!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T04:55:57+00:00Added an answer on May 29, 2026 at 4:55 am
    <div style="width:200px;height:200px;overflow:scroll">
        <br><br><br><br><br><br><br><br><br><br><br><br><br><br>
        <div id="hello">autoscroll here</div>
        <br><br><br><br><br><br><br><br><br><br><br><br><br><br>
    </div>
    

    then open the page as

    page.html#hello
    

    this is the only thing you can do, with HTML only

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose we have the following code: <div id=test style=width:200px; height: 200px; overflow: hidden;> <p>Lorem
Suppose I have the following HTML code: <div id=container style=width: 960px> <div id=help_panel style=width:
Suppose I have the following HTML: <div id=test> <span style=display:inline;>foo</span> <span style=display:none;>bar</span> <span style=display:inline;>baz</span>
Suppose you have this following code in HTML - <div id=pattern> <span class=a>Content</span> </div>
Suppose I have the following HTML: <div class=container> <span class=remove>remove</span> </div> and jquery: $(.container).delegate(.remove,
Suppose I have the following HTML and js <div> <div class=testdiv id=test1>test</div> <div class=testdiv
Suppose I have the following html: var testString = ' <span id='id'> <div> <table>
Suppose I have the following html, and no CSS <div> here is some content
Suppose I have the following DIV <div id=myDiv style=display:none title=></div> I have an ajax
Suppose I have the following HTML: <form id=myform> <input type='checkbox' name='foo[]'/> Check 1<br/> <input

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.