Gaelon Swift Gaelon Swift - 2 months ago 4x
CSS Question

Scroll bar that has a dynamic height

I created a page that has 2 pictures next to each other, each taking 50% width. the left is say 300x900, the right is 300x1800. I need to constrain the height to no more then 900 so i put a scroll on the taller pic (right side). both pics scale dynamically with the browser window, but the scroll height is staying at 900. I need it to shrink down in height dynamically like the pictures if the browser window is scaled down. I want the scrollbar to match scale in height to the pic on the left (the one with the max height of 900). Is this possible? Thanks for any help!


Thank you for the help everyone! Here is the answer i came up with and its working! (the 134.7% is the aspect ratio of the picture i need the "scrollbar" picture to link to. #Scroll {height: auto; max-height: 0px; padding-bottom: 134.7% ; overflow-y: auto}