Jump to content
MakeWebGames

css columns


mikemastah

Recommended Posts

I have the following problem:

divprob.png

I have '<div> C' in that div i have both '<div> A' and '<div> B'

what I want is that whenever A or B expands C also expands (not like in the image where B overlaps D)

I tried

.C {
   position: relative;
   width: 846px;
   height: 100%;
}

.B {
   position: absolute;
   right: 0;
   width: 250px;
   margin-left: 596px
}

.A {
   width: 590px;
   left: 0;
}

but it didn't work and gave me the result in the image.

I also tried floats but it gave me the same result.

I have no idea what else to try please help.

Link to comment
Share on other sites

Re: css columns

Try adding a div with clear: both after a and b, but in c.

 

<div id="c">
   <div id="a">
   </div>
   <div id="b">
   </div>
   <div id="blocker" style="clear: both; width: 100%">
   </div>
</div>

 

That will cause the "blocker" div to expand c ;)

Hope that helps...

Link to comment
Share on other sites

  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...