float がある状態でも最小の行幅を指定する方法
Published: 2021/5/21
::before
の擬似要素などによって、<p>
の直前などに高さ0の block を配置して、そこで width ないし min-width を指定する。
出典
Minimum Paragraph Widths in Fluid Layouts | CSS-Tricks
In fluid width environments, the text that wraps around floated elements can get awkwardly narrow and trap bits of text orphaned away from the rest of the paragraph. This article explains that problem in more details and offers a few solutions.
css-tricks.com