Web Platform Team Blog

Making the web awesome

Finding the First Layout Location Within a Polygonal CSS Exclusion Shape

Note: CSS Shapes syntax has changed. For the latest information, see CSS Shapes Module Level 1.

Hans Muller has been investigating how to layout inline text within or around a CSS Exclusion Shape. Previously, he wrote about an algorithm that would help detecting the text rectangle that would intersect a CSS Exclusion shape outside or within.┬áRecently he’s been working to solve a related problem, finding the initial location to begin laying out text. It turns out, it’s not as simple as beginning from the top of the exclusion shape.

Read more on his blog to find out about the algorithm to detect first layout location within a polygonal CSS exclusion shape and play with a JavaScript implementation of that.

Comments are closed.