32 lines
987 B
HTML
32 lines
987 B
HTML
<html>
|
|
<head>
|
|
<style>
|
|
/*
|
|
The aspect-ratio preserving object-fit:cover property causes the 10x100 image to be scaled to 100x1000 and then centered.
|
|
The shape-outside is clipped to the image-shape's margin-box, which means that most of the scaled image will be clipped away.
|
|
*/
|
|
#image-shape {
|
|
float: left;
|
|
-webkit-shape-outside: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10px' height='100px'><rect width='10' height='100' fill='blue'/></svg>");
|
|
width: 100px;
|
|
height: 200px;
|
|
margin-right: 50px; /* expose shape-outside property failures */
|
|
object-fit: cover;
|
|
}
|
|
|
|
#content {
|
|
font: 50px/1 Ahem, sans-serif;
|
|
-webkit-font-smoothing: antialiased;
|
|
color: green;
|
|
}
|
|
</style>
|
|
<div id="content">
|
|
<img id="image-shape"
|
|
src="data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10px' height='100px'><rect width='10' height='100' fill='blue'/></svg>">
|
|
</img>
|
|
X<br>X<br>X<br>X<br>X
|
|
</div>
|
|
</body>
|
|
</html>
|
|
|