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 7641105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:50:23+00:00 2026-05-31T08:50:23+00:00

This <div id= style=overflow:scroll; height:400px;> gives a div that the user can scroll in

  • 0

This

<div id="" style="overflow:scroll; height:400px;">

gives a div that the user can scroll in both in horizontally and vertically. How do I change it so that the div is only scrollable vertically?

  • 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-31T08:50:24+00:00Added an answer on May 31, 2026 at 8:50 am

    You have it covered aside from using the wrong property. The scrollbar can be triggered with any property overflow, overflow-x, or overflow-y and each can be set to any of visible, hidden, scroll, auto, or inherit. You are currently looking at these two:

    • auto – This value will look at the width and height of the box. If they are defined, it won’t let the box expand past those boundaries. Instead (if the content exceeds those boundaries), it will create a scrollbar for either boundary (or both) that exceeds its length.

    • scroll – This values forces a scrollbar, no matter what, even if the content does not exceed the boundary set. If the content doesn’t need to be scrolled, the bar will appear as “disabled” or non-interactive.

    If you always want the vertical scrollbar to appear:

    You should use overflow-y: scroll. This forces a scrollbar to appear for the vertical axis whether or not it is needed. If you can’t actually scroll the context, it will appear as a”disabled” scrollbar.

    If you only want a scrollbar to appear if you can scroll the box:

    Just use overflow: auto. Since your content by default just breaks to the next line when it cannot fit on the current line, a horizontal scrollbar won’t be created (unless it’s on an element that has word-wrapping disabled). For the vertical bar,it will allow the content to expand up to the height you have specified. If it exceeds that height, it will show a vertical scrollbar to view the rest of the content, but will not show a scrollbar if it does not exceed the height.

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

Sidebar

Related Questions

I have this div element: <div id=tl style=float:right;width: 400px; height:100px; background-color:Green; overflow-x: scroll;overflow-y: hidden;>
In Firefox...... <div id=container style=overflow:scroll; width:400px; height:500px> <div id=content style=height:500px; width:800px/> </div> The container
Given this HTML snippet: <div id=box style=overflow:auto; width:200px; height:200px; border:1px solid black;> 1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>10<br> 11<br>12<br>13<br>14<br>15<br>16<br>17<br>18<br>19<br>20<br>
Try this showcase: <!doctype html> <html> <head> <style> html { min-height: 100%; overflow-y: scroll;
The following is a 3 x 3 table: <html> <body style=overflow:hidden;> <style> div.table_div {overflow:scroll;width:378px;height:117px;position:relative;}
i have this: <div id=parent style=overflow:auto> ... <div id=test>Hello</div> ... </div> My question is:
I have this CSS style that does a rounded corners for div border, but
This problem is only in IE. Consider the following HTML: <html> <body> <div style='position:absolute;left:1em;right:1em;top:1em;bottom:1em;overflow:auto;>
what is the proper code for this? in div style code. I know how
I have a draggable div element with a hover style. This works fine, but

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.