2

I am trying to align 2 divs where the right content is fixed and the left is truncated to fill the remaining space. I found this How to place two divs side by side where one sized to fit and other takes up remaining space? (fiddle here http://jsfiddle.net/ssawchenko/gKnuY/) which is close, but I'd like the right div to not be floated right so if the text is small enough to fit the text appears side by side. Is this possible?

4

1 回答 1

0

在上面做这件事似乎是一种疯狂的方式。判断这是否是您想要的:http: //jsfiddle.net/joplomacedo/gKnuY/404/

的CSS:

.fixed {  
   float:right;
   width: 200px;
}​

.fluid {
    margin-right: 200px; /* same as fixed's width */
}

的HTML:

<div class="fixed"></div>
<div class="fluid"></div>    
于 2012-09-22T03:30:03.093 回答