2

I have the following html code:

<div class="a">
    <div class="b">
        <a href="#">text</a>
    </div>
    <div class="c">
        text
    </div>
</div>


div.a
{
    margin-top: 10px;
    clear: left;
    float: left;
    width: 100%;
    text-align: center;
}

div.b
{
    padding: 27px 10px 7px 10px;
    background-color: #fff;
    overflow: hidden;
    float: left;
}

div.c
{
    float: left;
}

What styles should I set for div.c to make it be beside the div.b and fit the remaining width?

It's for a tempalte that will fit 100% of the screen.

thanks!

Paulo
  • 7,123
  • 10
  • 37
  • 34
  • Is does already take the width. Do you mean how to line it up in terms of height? – Damo Apr 07 '09 at 18:35
  • I edited... div.c is floated left... – Paulo Apr 07 '09 at 18:39
  • Possible duplicate of [Make a div fill up the remaining width](https://stackoverflow.com/questions/4873832/make-a-div-fill-up-the-remaining-width) – TylerH Aug 24 '17 at 15:50

1 Answers1

6

<div class="a">
 <div class="b">
  <a href="#">click here to be amazed!</a>
 </div>
 <div class="c">
  this is some awesome text
 </div> 
</div>

<STYLE>
 .b,.c {
  padding:15px;
 }

 div.a {  
  border: 1px solid red;
 }

 div.b {
  float: left;
  border: 1px solid blue;
 }

 div.c {
  border: 1px solid green;
 }
</STYLE>
cobbal
  • 69,903
  • 20
  • 143
  • 156
Chase Seibert
  • 15,703
  • 8
  • 51
  • 58