yossi
yossi

Reputation: 296

How to expand the div to fill the width of any size in the middle column will be?

Demo jsFiddle I have div color azure I want to fill the width area in the middle column no meter what size will be. is there any solution with css3/css no jQuery ?

i need it like this picture: enter image description here

the ststus current like this:

many Thx.

enter image description here Demo jsFiddle

the code html:

<div id="frame">
  <div id="inside_window">
    <div id="Yellow"></div>
    <div id="Green"></div>
        <div id="Blue"></div>
    <div id="Red"></div>
    <div id="ver"></div>
    <div id="hor"></div>
    <div id="ver2"></div>
  </div>
 </div>

​ the code css:

  html, body{
  height:100%;
   background-color: azure;
            } 
    #frame
{
position: relative;
background-color: black;
height: 100%;
width: 100%;
margin: auto;
padding:0;
border: 1px solid black;
}

#Yellow
{
position: absolute;
height: 100%;
width: 150px;
-webkit-border-radius: 0px;    
margin: 0 ;

    background-color: Yellow;
    z-index:10;
    display:table;

left:0px;
top:0; 
}

#Green
{
position: absolute;
height: 100%;
width: 150px;
-webkit-border-radius: 0px;    
margin: 0 ;

    background-color: green;
    z-index:10;



right:0px;
top:0; 
}

#Blue
{
position: relative;
height:100%;
min-width:65.8%;
-webkit-border-radius: 0px;    
margin: 0 auto;

    background-color: #62A9FF;
    z-index:10;
    display:table;
    font-size:220%;


left:0px;
top:0px; 
}

#Red
{
position: absolute;
height: 150px;
width: 100%;
-webkit-border-radius: 0px;    
margin: 0 ;

    background-color: red;
    z-index:10;
    border: 1px solid black;

left:0px;
bottom:0px; 
}

#inside_window
{

width:100%;
height:100%;
margin:0 auto;    
position: relative;
border: 1px solid black;

background-color: brown;
-webkit-transform: rotate(0deg); 
-webkit-transform-origin:50% 50%; 
}
#ver
{
position: absolute;
    height: 100%;
    width: 5px;
    margin: 0;
    background-color: white;
    left:150px;
    top:0px;   
    z-index:1;
}
#hor
{
position: absolute;
    height: 5px;
    width: 100%;
    margin: 0;
    background-color: white;
    left:0px;
    bottom:150px;
        z-index:20;
}
#ver2
{
position: absolute;
    height: 100%;
    width: 5px;
    margin: 0;
    background-color: white;
    right:150px;
    top:0px;   
    z-index:1;
}
​

Upvotes: 0

Views: 690

Answers (2)

chipcullen
chipcullen

Reputation: 6960

There are many ways to acheive a layout like this. Supposing that you could alter the order of your content, you could always try the "Holy Grail" layout method.

Upvotes: 1

DBUK
DBUK

Reputation: 1373

Try removing the following CSS from your blue code:

position: relative;
display:table;

Upvotes: 1

Related Questions