CSS: One column's width relative to resizable 100% height square? -


this question kind of hard explain i've created jsfiddle:

http://jsfiddle.net/zljhn/ (or see html/css below)

basically want square shaped video on right size of screen 100% height , left column fill rest of available screen space. i've been working on problem few hours appreciated!

edit: left column contain number of paragraphs/images centered in available space (not single paragraph example code shows.

css:

.profile_page {     width: 100%;     height: 100%;     position: absolute; } .left {     float:left;     width: 100%;     position: relative; } video {     top: 0;     right: 0;     border: 1px solid red;     float: right;     height: 100%;     position: absolute;     max-width: 80%; } 

html:

<div class="profile_page">     <div class="left">         <p>this paragraph's width should adjust according videos width.</p>     </div>      <video src="http://stream.flowplayer.org/trains/640x360.mp4" />  </div> 

thanks!

taboo sounds, answer table layout. two-cell table row exhibits layout behavior you're looking without javascript. if you're concerned semantic html (and should be) can accomplish using display:table-cell; , display:table-row; in css.

this limit browsers correctly display layout.

<div class="profile_page">     <div class="left">         <p>this paragraph's width should adjust according videos width.</p>     </div>     <div class="right">         <video src="http://stream.flowplayer.org/trains/640x360.mp4" />      </div> </div> 

and style...

.profile_page {     width: 100%;     height: 100%;     position: absolute;     display:table-row; } .left {     min-width: 100px;     display:table-cell;     border:1px solid green;     vertical-align:top; } .right {     display:table-cell;     border:1px solid blue;     max-width:80%;     min-width:300px; } video {     top: 0;     right: 0;     height: 100%;     width: 100%; } 

see fiddle: http://jsfiddle.net/nkelc/1/


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -