要素の幅を固定せずに、幅を設定するときに親 div 要素がテキストを無視するようにします。要素の幅が画像の幅だけに影響されるようにしたい。
<div>
<img src="https://lh4.ggpht.com/9BAW9uE48gxNUmnQ7T6ALpNTsrCHOZBMfF__mbamBC36edSw0uc-kjQxgtZ3O3aQWFY=h900"/>
<p>I want this text to wrap once this paragraph element reaches the width of the image.</p>
</div>
div {
background: green;
display: inline-block;
}
どんなアドバイスでも大歓迎です