set two div to same height?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • rockdale

    set two div to same height?

    Hi,

    I am used to use <table<tr<tdt o 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
  • David Stone

    #2
    Re: set two div to same height?

    In article
    <13a9a729-70d4-4975-81dc-00f1f4f4c1e1@p2 5g2000hsf.googl egroups.com>,
    rockdale <rockdale.green @gmail.comwrote :
    Hi,
    >
    I am used to use <table<tr<tdt o 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!

    Comment

    • dorayme

      #3
      Re: set two div to same height?

      In article
      <13a9a729-70d4-4975-81dc-00f1f4f4c1e1@p2 5g2000hsf.googl egroups.co
      m>,
      rockdale <rockdale.green @gmail.comwrote :
      Hi,
      >
      I am used to use <table<tr<tdt o 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.a u/floatHouse>.
      In particular, page 8, 9 and 10.

      --
      dorayme

      Comment

      Working...