Question: In the following code (<https://jsfiddle.net/6t9n0wuu/>):

```css
#cont1 {
  width: 50%
}

#div1 {
  width: 10px;
  float: left;
  border: 1px solid black
}

#div2 {
  float: left;
  border: 1px solid black
}
```

```html
<div id=cont1>
  <div id=div1>a<br>b<br>c<br></div>
  <div id=div2>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
    in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
  </div>
</div>
```

the content of `div2` is shifted to a new line. 

Is it possible to force `div2` on the top as (i.e. on the same line of) `div1` without specifing its width in CSS?

Answer: 
Just remove `float:left` of `#div2` and insert `margin-left:10px` to it.

```
#div2 {
  float: left;<---------Remove
  margin-left: 10px;<-----Added
  //more code.....
}

```

```css
#cont1 {
  width: 50%;
}
#div1 {
  width:10px;
  float:left;
  border:1px solid black;
}
#div2 {
  border:1px solid black;
  margin-left: 10px;
}
```

```html
<div id="cont1">
<div id="div1">a<br>b<br>c<br></div>
<div id="div2">
  Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
  </div>
</div>
```
You can use Flex property:

```
#cont1 {width: 50%; display: flex;}
#div1 {width:10px; border:1px solid black; flex: 0 0 10px}
#div2 {border:1px solid black; flex: 1 1 auto}

```

<https://jsfiddle.net/6t9n0wuu/1/>