467,074 Members | 923 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,074 developers. It's quick & easy.

set two div to same height?

Hi,

I am used to use <table<tr<tdto do my html layout. As it is
considered an old technology, I am trying to understand how div and
css works. Here are some simple questions(maybe pretty silly to you
guys).

I have a div container contains two divs side by side, How can I set
the height of the short one to the same height of the taller one?

#container {
FLOAT: left; WIDTH: 540px
}
#left-column
{
FLOAT: left; WIDTH: 49%;
}
#right-column
{
FLOAT: right; WIDTH: 49%;
}
------------------
<div id=container>
<div id=left-column>
</div>
<div id=right-column>
</div>
</div>
Another question, How can I extend an inside to the height of its
container?

thanks in advance
Feb 21 '08 #1
  • viewed: 6477
Share:
2 Replies
In article
<13**********************************@p25g2000hsf. googlegroups.com>,
rockdale <ro************@gmail.comwrote:
Hi,

I am used to use <table<tr<tdto do my html layout. As it is
considered an old technology, I am trying to understand how div and
css works. Here are some simple questions(maybe pretty silly to you
guys).

I have a div container contains two divs side by side, How can I set
the height of the short one to the same height of the taller one?
The short answer is that you can't make both columns the
same _actual_ height, but you can make them _appear_ to be
the same height, which is often just as good.

This gets asked at least once a week here, so you could try
searching the group in Google to see what has been suggested
in the past.

Alternatively, you could browse through my own tests of different
approaches at: http://www.chem.utoronto.ca/~dstone/twocol/
Let me know if anything is incorrect or doesn't work!

PS: if you view the source for the index page and scroll
down the bottom, there's a bunch of links in a comment that
have yet to make it onto their own links page; you may well
find those useful, since I did!
Feb 21 '08 #2
In article
<13**********************************@p25g2000hsf. googlegroups.co
m>,
rockdale <ro************@gmail.comwrote:
Hi,

I am used to use <table<tr<tdto do my html layout. As it is
considered an old technology, I am trying to understand how div and
css works. Here are some simple questions(maybe pretty silly to you
guys).

I have a div container contains two divs side by side, How can I set
the height of the short one to the same height of the taller one?
....
>
Another question, How can I extend an inside to the height of its
container?
You might find some help at <http://netweaver.com.au/floatHouse>.
In particular, page 8, 9 and 10.

--
dorayme
Feb 21 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by zing | last post: by
6 posts views Thread by spasmous@yahoo.com | last post: by
3 posts views Thread by Rennie deGraaf | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.