Get DIVs one to another + get independent size

Hello.

How could I get blue next to yellow?
(I cannot use float: because reasons)

The second question is.

How do I get blue the size of red. Without red having % or px height. But instead it’s visual size is being treated by how big it’s other elements are (look how yellow is enlarging the red, I need blue to be 100% height red)

Thanks :smile:

1 Like

FOUND IT!!

I would have gone with display table:-

div {
  max-width: 350px;
  background-color: red;
  display: table;
}

div#one {
  display: table-cell;
  background-color: blue;
}

div#two {
  width: 75%;
  display: table-cell;
  background-color: yellow;
}

Or flex-box if feeling more adventurous.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.