# Move image to top of the page (like LaTeX’s \begin{figure}[t])

Before I start, let me be clear about what I’m not trying to do:

• I’m not trying to keep particular text on the same page as an image.
• I’m not trying to force a page break before an image.

That said, I’m looking for the approximate equivalent of LaTeX’s \begin{figure}[ht]. Basically,

• If there’s enough room on this page for the image, put it here.
• Otherwise, put it on the top of next page—but don’t break the page here; put the next paragraphs of text here until the end of the page.

Can this be done with HTML+CSS? (The answer to Can I float an image to the top or the bottom of the screen? is not encouraging, but does not address this directly.)