0

I'm trying to make a horizontal layout (with columns) where the content scales based on the browser window height.

I came across answers about perfect ratio based on width, but I want to have an infinite width (as the amount of content won't always be the same).

Is this possible just using HTML/CSS?

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
  • In short, yes it is possible... What exaclty don't you understand from those pages? Your first URL looks like excactly what you describe here and comes with complete code samples. – Neograph734 Apr 02 '13 at 11:25
  • The first URL says nothing about content scaling. When I try to change the CSS to respond to browser height, instead of width, nothing appears. – user2234137 Apr 02 '13 at 19:27

1 Answers1

0

It is going to be hard to maintain the aspect ratio with css, but if you set the height of the maincontent box to 90% and the height of the containers to 100%. They should respond to the browser window. But only in height, never in width.

From there you can use javascript to set the with to be <height> * 1.5 (or similar) you will have to do this in the document ready event, but also in the window resize event.

Neograph734
  • 1,714
  • 2
  • 18
  • 39
  • Thanks, I've never learned javascript so I was trying to do my best with CSS, but I guess I'll just give it a shot in javascript. – user2234137 Apr 04 '13 at 07:47