1

What i am trying to achieve here, is that how can auto calculate the height of the content, so that content height should be the height of the image. Even if I resize it should take the content height.

I tried using using flex: 1 on second-column, but didn't worked

The content and image should horizontally end equally, now you can see space on first-column because of the image height, I want it to happen reversely based on the content height only image height should show even I resize the screen also

Any help is appreciated

.container {
  display: flex;
  justify-content: space-between
}

.first-column {
  padding: 16px 0 16px 16px;
  border: solid 1px;
}
<div class='container'>
  <div class='first-column'>
    Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has
    survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing
    software like Aldus PageMaker including versions of Lorem Ipsum.
  </div>
  <div class='second-column'>
    <img src='https://picsum.photos/176/274' alt='dummy-img' />
  </div>
</div>
dev
  • 814
  • 10
  • 27

0 Answers0