I have a problem with my css. I have 2 div "left" and "main" in a container div "container". My container's width is 90℅ of the body's width, and have a margin: %3 auto ( to center the container ).
.container{
margin:3% auto;
width:90%;}
Now, i want somethink special in my container: my "left" width = 20% of the container, a margin right on this " left div" to separate the "left" and the "main"
#left {
display:inline-block;
padding:10px;
background-color:#32CD32;
vertical-align:top;
list-style:none;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
border:solid 2px black;
/*width:????? HERE I WANT AN ADAPTABLE WIDTH TAKING 20% OF THE CONTAINER WIDTH*/}
And my main's width have to take the rest of the container's width.
#main {
background-color:#32CD32;
vertical-align:top;
display:inline-block;
padding:10px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
border:solid 2px black;
text-align:center;
/*width:80%; HERE, I WANT AN ADAPTABLE WIDTH TAKING THE REST OF THE CONTAINER*/}
But when i use % for the main's width and the left's width, it take the body ℅. Moreover, i dont know how to say " take the rest of the container's width.
<div class="container">
<div id="left">
<li>LIST1</li>
<li>LIST2 </li>
<li>LIST3 </li></div>
<div id="main">
<div id="new_comment"class="eblock">new comment</div>
<div id="comments"class="eblock">
<div id="onecomment"> new comment </div>
<div id="onecomment"> new comment </div>
<div id="onecomment"> new comment </div>
<div id="onecomment"> new comment </div>
<div id="onecomment"> new comment </div>
</div>
</div>
</div>
Thanks for the help.