css - How to anchor a dynamic div to the screen? -


i'm looking way devide screen 2 divs. 1 small fixed sized on left , 1 dynamic width on right.

i didn't figured out how yet. because width in percentage not proportional.

for example: http://jsfiddle.net/acmnu/2/

if resize result field or overall width see green div not resize in proportion screen. if field gets small green div slips under red one.

what need kind of anchor. green div fill entire screen without getting big.

html:

<body>     <div id="content">         <div class="left">left</div>          <div class="right">right</div>     </div> </body> 

css:

body { height: 300px; }  #content {     height: 100%; }  .left {      float: left;     margin-left: 10px;     background-color: red;     height: 100%;     width: 200px; } .right {     float: left;     margin-left: 10px;     background-color: green;     height: 100%;     width: 80%; } 

i hope have interpreted question correctly. can try fiddle

body {     height: 300px; }  #content {     height: 100%; }  .left {     float: left;     margin-left: 10px;     background-color: red;     height: 100%;     width: 200px; } .right {     margin-left: 200px;     background-color: green;     height: 100%; } 

i have set margin-left of .right equal of width of .left. don't float right panel , fill remaining space.

result


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -