Game Development Reference
In-Depth Information
<h2>Lorem Ipsum</h2>
<p>Lorem ipsum dolor sit amet, consectetuer
adipiscing elit, sed diam nonummy nibh euismod
tincidunt ut laoreet dolore magna aliquam erat
volutpat. Ut wisi enim ad minim veniam, quis
nostrud exerci tation ullamcorper suscipit
lobortis nisl ut aliquip ex ea commodo
consequat. Duis autem vel eum iriure dolor in
hendrerit in vulputate velit esse molestie
consequat, vel illum dolore eu feugiat nulla
facilisis at vero eros et accumsan et iusto
odio dignissim qui blandit praesent luptatum
zzril delenit augue duis dolore te feugait
nulla facilisi.</p>
</div>
This trivial snippet simply tells the rest of the content inside that div element to flow
around the image from its right side. Even if we had an SVG object in the place of
that image, and this object was a polygon shaped like a triangle pointing to the right,
the text would wrap around the object treating it like a rectangle.
However, with the magic of CSS exclusions, we can add properties to the image tag
or the SVG object that would alter the way its outer shape is interpreted. By default,
since any HTML element has an x and y position, along with a width and height
attribute, every element is treated like a rectangle. Using the shape property changes
that.
<style>
h2, p {
margin: 0 0 10px;
}
svg {
float: left;
width: 300px;
height: 400px;
shape-outside: polygon(0 0, 100% 50%, 0 100%);
Search WWH ::




Custom Search