Say I have 3 div
s like this:
#wrapper {width:100%; border:1px solid #ccc}
#wrapper div {box-sizing: border-box; float:left; border:1px solid #777}
#wrapper #first {width:30%}
#wrapper #second {width:70%}
#wrapper #third {width:30px}
<div id="wrapper">
<div id="first">A</div>
<div id="second">B</div>
<div id="third">C</div>
</div>
What I want:
- The 3 divs all floating in a row in a flexible container;
- The
width
of 3rd div is always a fixed value, like30px
; - The first and second div has
width
in a percentage value, to use the rest room of the container.
For instance, if the container is 100px, the 3rd div is 30px and the first is (100-30)*30% = 21px
, the second is (100-30)*70% = 49px
.
What is the correct way to do this?
Thanks