I am trying to get 2 divs to sit side by side, with one of the divs expanding to fill empty space.
The site I am working on has a link, with a colour block beside it. The colour block should remaining width of the div, depending on how much space the link text takes up.
Originally, I tried floating Divs side by side but this didn't work when lowering the screen size. I have also tried inline-block but this didn't work either.
Finally, I tried the resolution here, again this did not work. Where am I am going wrong?
My code is:
<div class="link-wrapper">
<div class="block yellow">
</div><!--/ Block -->
<div class="link">
<p><a href="#</a></p>
</div><!--/ Link -->
</div>
CSS is:
.link-wrapper{
width:100%;
overflow:hidden;}
.block{
overflow:hidden;
height:15px;}
.link{
float:right;}