I am using float to put a img and p in the same line, this work like this:
<div class="clearfix">
<h1>img(float: left) ; (p float: none)</h1>
<img src="http://via.placeholder.com/640x100" style="float: left"/>
<p>
Text1
</p>
</div>
That work correctly (img and p in the same line). BUT if I set the width property in the p like this:
<div class="clearfix">
<h1>img (float: left) ; p(with width float: none)</h1>
<img src="http://via.placeholder.com/640x100" style="float: left"/>
<p style="width: 300px;">
Text1
</p>
</div>
That does not work like I expect (img in one line and p in another) (I do not understand why) And if I set explicity float left in the p element like this:
<div class="clearfix">
<h1>img (float: left) ; p(with width float: left)</h1>
<img src="http://via.placeholder.com/640x100" style="float: left"/>
<p style="width: 300px;float:left">
Text1
</p>
</div>
that works properly too.
So my questions are:
why set width destroy the float flow?
why set width and set also float in the p does work and what is difference between set float in all element and set float in the first element only?
I know I can use flexbox and grid but i am talking about float.
EDIT: image with borders in p Preview of 3 examples:
Complete example here: