css – shrink a parent div to fit one child’s width and constrain the width of the other child [duplicate]

See this edited version of your jsFiddle.

Here’s what’s added to the CSS:

#container {
    display: table-cell;
}
#child1 {
    display: table-row;
    width: 1px;
}
#child2 {
    display: table-cell;
    width: 1px;
}

Leave a Comment