473,324 Members | 2,473 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

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
2 6613
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: zing | last post by:
Hello, I want to define n columns that appear with specific background colors, different to the body background (i.e. so you can see the area they occupy). I want the columns to be of the same...
0
by: Henke | last post by:
Hello, i redesign a Website to get rid of some tables. My Problem is: the navigation has a blue background and should be the same length as the content. i tried putting them in one parent...
6
by: spasmous | last post by:
I'm getting an error when using a C program that accepts **float as arguments in my C++ code. Here the code (short): float A = {0,0,0,1,2,0,3,4,0}; float W = {0,0,0}; float V =...
3
by: Rennie deGraaf | last post by:
Is it possible to force adjacent block elements to have the same height, without specifying that height? In this page (http://pages.cpsc.ucalgary.ca/~degraaf/test/index3.html), I have a bunch of...
7
by: Gary | last post by:
Hi i'm exploring a tutorial stylesheet which uses the following code #header ul li a { .... line-height: 0.8em !important; line-height: 1em; .... }
2
by: pammyspammy | last post by:
Hi - Some background info: I'm helping to redesign an internal website at work, and I've decided to use CSS, though I don't really have any experience with it. I figure now's a good time to...
7
by: NJonge01 | last post by:
Hi, I'd like to produce a report that basically looks like an excel printout. Description: Profile Print Report Detail Section with 3 bordered text boxes all text boxes are 'abutted'...
3
by: vanald04 | last post by:
Tried searching for the right article and saw some similar questions that if I knew more would probably be helpful, but I couldn't get the coding exactly right for my specific situation. So, thanks...
3
by: jrod11 | last post by:
Hi everyone, I'm working on creating a company intranet or my company and having trouble with IE. I have a navigation bar at the bottom of my page that is a quick links bar and is a fixed...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.