I have a parent div of a fixed width, and 3 divs inside, in one line. I would like that the 2nd and 3rd divs have the widths that fit its' contents, and 1st div would occupy the rest of the parent's width. All divs are single lines of text (`nowrap`), first column can truncate text if it is too long (`overflow:hidden`).
I don't want to specify any widths explicitly, apart from the parent div.
span me me me me me me me
abc
def
div {
border: 1px solid black;
float: left;
white-space: nowrap;
overflow: hidden;
}
div#main {
width:200px;
}
div#col1 {
/*width:150px;*/ /* I don't want this! */
}
div#col2 {
float:right;
}
Fiddle here:
http://jsfiddle.net/FMB2M/
it's overflow:hidden;
not overlap...以上就是Div with maximum possible size (column spanning available width)的详细内容,更多请关注web前端其它相关文章!