Div won't fill size of parent container
I have a problem in which I am making a website wh开发者_如何学编程ich will have a main content section and a "Updates" bar on the right side. Here is the link. http://bebiafricanhairbraiding.com/
You should be able to get the code from the website itself but if you need the code I can post it here. Thanks.
Is it really important that the div's are the same height, or that the background is the same length? I guess the latter. Instead of trying to get the div's to be the same height (which won't work), create two positioned div's and set the background on their parent. The rounded corners at the bottom should be done in a separate footer element.
So like this:
+-----+-----+
| a | b |
| +-----+
| |
+-----------+
| c |
+-----------+
a is your content column, b is your sidebar. Both are (together) contained in a parent div, which has a background. c is the footer with rounded corners.
See also http://www.alistapart.com/articles/fauxcolumns/.
I would also really recommend to use a css framework like http://twitter.github.com/bootstrap/. This makes it a lot easier to make grids, nice typography, etc.
#content has height:100% and #update has height:250px
Set the updates height
#updates {height:100%}
精彩评论