Public key; without containers and additional <div>
Another answer was almost right, but skipped width: 100% . Here is the revised version.
h1 { clear: both; display: inline-block; width: 100%; }
Clearing without this width: 100% requires that the floating element be in a well-marked container or need an additional semantic empty <div> . Conversely, a strict separation of content and premiums requires a strict CSS solution to this problem, i.e. without any additional non-semantic HTML.
The fact that it is necessary to mark the end of the float does not allow automatic layout .
If the latter is your goal, the float should be left open for anything (paragraphs, ordered and unordered lists, etc.) to wrap around it until it becomes clear. In the above example, the cleanup is set with a new header.
This solution is widely used on my website to solve the problem when the text next to the floating thumbnail is short and the top edge of the next cleaning object is not respected. It also prevents any manual intervention in the automatic creation of PDF files from the site.
Serge Stroobandt Apr 08 '15 at 11:24 2015-04-08 11:24
source share