By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,676 Members | 1,773 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,676 IT Pros & Developers. It's quick & easy.

set two div to same height?

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.