Communities for your favorite technologies. Explore all Collectives
Ask questions, find answers and collaborate at work with Stack Overflow for Teams.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
How can i code a scrollable div ? perfectly with a blue border.
Is there a way to code this?
Like a window in a window -> two scrollbars
I don't know the id of your div but mine is box.
box
Add this to your code:
#box { width: 1620px; margin-right: auto; margin-top: 20px; background-color: white; box-shadow: #254C58 1px 0px; border: #3C7D91 5px double; padding: 10px 10px 10px 10px; overflow-y: scroll; max-height: 433px; }
Add a comment
If you want to scroll horizontally, add overflow-x:scroll to your CSS and when your div expands past its defined width it will become scrollable.
overflow-x:scroll
Inversely, overflow-y:scroll should be added to allow vertical scrolling as well under the same circumstances.
overflow-y:scroll