susanloek susanloek - 1 year ago 91
CSS Question

Use available width with css

I've a special case. I want a div use the available width.

This is my code:

.parent {
width: 100%;
.child-left {
width: 66%;
float: left;
.child-right {
width: 33%;
min-width: 400px;
float: right;

<div class="parent">
<div class="child-left">
Lorem Ipsum
<div class="child-right">
Lorem Ipsum

element should be minimum 400px width. If i resize the screen the element breaks down. Is there a way, that the
element use the available horizontal space? Maybe CSS-Flexbox?

Answer Source

I think you can do it with flex yes.

  justify-content: space-between;
  flex-basis: 400px;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download