Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Auto height not working

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #183356
    united9
    Participant

    Hi,

    I’m using two div’s side by side with float left and float right, and I need both them of same auto height, can you please let me know how it become possible.

    I’ve one div for text and other for Apply now button, but the div for apply now button is not assuming height of text div.

    Here is the code I’ve

    [MOD EDIT – Extensive Codedump Removed]

    #183359
    Paulie_D
    Member

    Please no mega codedumps. They take up way to much space, are rarely comprehensive and hard to read.

    Make a reduced case in Codepen.io and we can see what can be done.

    Or your could do a search

    https://css-tricks.com/search-results/?q=equal+height

    #183384
    united9
    Participant

    Please check if you can help on this.

    https://gist.github.com/anonymous/5fbf68aa5c5f19ab1a15

    Thank You.

    #183609
    PrincipOfCode
    Participant

    Hi united9,
    You can use display property in css, change to “display: table;” in the container of both divs, and for both divs declare them as “display: table-cell;”, so you also don’t need to use “float: left” or right ..
    instead you can use “padding” with “box-sizing: border-box;” inside the divs and the container.
    In this way you can leave “height: auto;” inside your divs … it will stretch the height of your divs to the height of the bigger of them ..

    #183670
    united9
    Participant

    Really Cool, It is working with display:table property, Thank You “PrincipOfCode” for this kind answer.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘CSS’ is closed to new topics and replies.