1

How can I have a text wrapping around an arbitrarily positioned image or shape within a single block of text?

enter image description here

image is property of https://www.sarasoueidan.com/blog/css-shapes/


Note that I am not looking for a solution that involves separate columns of text such as this one which exploits left/right floats with shape-outside.
enter image description here

Temani Afif
  • 245,468
  • 26
  • 309
  • 415
Qwerty
  • 29,062
  • 22
  • 108
  • 136

1 Answers1

2

At this moment, this behaviour is not supported, however, there is a draft for it.

More reading:
https://css-tricks.com/exclusions-will-hopefully-be-like-more-powerful-grid-friendly-floats/
https://www.sarasoueidan.com/blog/css-shapes/
https://drafts.csswg.org/css-exclusions-1/

CSS Exclusions Module Level 1

Editor’s Draft, 16 January 2020

CSS Exclusions define arbitrary areas around which inline content can flow.

enter image description here


CSS Shapes Module Level 2

Note that there also was a shape-inside property, which would have been possible to use as a workaround with a proper polygon, but its support was removed and implementation postponed until https://drafts.csswg.org/css-shapes-2/. So right now, it is only possible to use shape-outside with a float-ing element.

enter image description here enter image description here
images property of https://www.sarasoueidan.com/blog/css-shapes/

The initial Shapes specification included a property shape-inside for creating shapes inside an element. This property, along with the possibility of creating shapes on non-floated elements, has been moved to level 2 of the specification. As the shape-inside property was initially in Level 1 of the specification, you may find tutorials on the web detailing both properties.
~ MDN

Qwerty
  • 29,062
  • 22
  • 108
  • 136