classlesscss icon indicating copy to clipboard operation
classlesscss copied to clipboard

Inline img tags within a p tag doesn't float to the right side

Open dmitriy-bodroff opened this issue 3 years ago • 1 comments

If there is <span> element, then float works.

image

But If there isn't <span> element, then float doesn't work.

image

I temporarily fixed it removed :not(:only-child).

image

Why was this :not(:only-child) selector added?

dmitriy-bodroff avatar Jun 15 '22 08:06 dmitriy-bodroff

Thanks for pointing this out. The :not(:only-child) selector was added to be compatible with Markdown converters such as pandoc. If the img is the only child of a paragraph, it most likely indicates a full-width figure and should not float. For the float to work, we would need a selector that also includes text.

emareg avatar Jun 27 '22 08:06 emareg