在图像周围环绕一些但不是全部文本

Wrapping some, but not all, text around an image

我正在尝试获得类似于下面这个的布局: 问题是我似乎无法让标题不换行,但让段落换行。到目前为止,这是我尝试过的方法:

我想我要么需要一个解决方案来让容器 div 始终与图像位于完全相同的位置,要么需要一个解决方案来包装段落而不是 header。在这一点上,我对任何和所有解决方案都持开放态度。以下是每个集合的 DOM 示例:

<div class="box"> <!-- container for the chunk -->
        <img src="" />
        <div class="box-txt"> <!-- container for the text so that I can position it on top of the image -- I've tried removing this and run into more positioning challenges -->
            <h2>This is the headline that shouldn't wrap.</h2>
            <div class="imgblock"></div> <!-- this element empty and set to float -->
            <p contenteditable="true">This is the paragraph that I need to wrap.</p>
        </div>
    </div>

您只需将浮动元素直接放在文本块之前, header 之后(就像您在代码示例中所做的那样)。然后 float: right; 将按照您描述的方式工作:

.box {
  width: 600px;
}

.imgblock {
  width: 300px;
  height: 300px;
  background: #ddd;
  float: right;
}
<div class="box">
  <!-- container for the chunk -->
  <img src="" />
  <div class="box-txt">
    <!-- container for the text so that I can position it on top of the image -- I've tried removing this and run into more positioning challenges -->
    <h2>This is the headline that shouldn't wrap.</h2>
    <div class="imgblock"></div>
    <!-- this element empty and set to float -->
    <p contenteditable="true">This is the paragraph that I need to wrap. This is the paragraph that I need to wrap. This is the paragraph that I need to wrap. This is the paragraph that I need to wrap. This is the paragraph that I need to wrap. This is the paragraph that I need
      to wrap. This is the paragraph that I need to wrap. This is the paragraph that I need to wrap. This is the paragraph that I need to wrap. This is the paragraph that I need to wrap. This is the paragraph that I need to wrap. This is the paragraph
      that I need to wrap. This is the paragraph that I need to wrap. This is the paragraph that I need to wrap. This is the paragraph that I need to wrap.</p>
  </div>
</div>