0

I want to limit the width of the hd but without having to set a width. I want it to occupy the full available width (width of the parent?)

.wrapper {
  outline: 1px #000 solid;
  width: 600px;
  margin: auto;
  display: flex;
}

.left {
  flex-grow: 1
}

.left h1 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.right {
  width: 200px;
  background-color: #CCC;
}
<div class="wrapper">
  <div class="left">
    <h1>this is a really really really long heading</h1>
  </div>
  <div class="right">right</div>
</div>
Temani Afif
  • 245,468
  • 26
  • 309
  • 415
handsome
  • 2,335
  • 7
  • 45
  • 73

0 Answers0