Awesome CSS Tricks

ZoomEffects/flower.jpg
1 -webkit-shape-image-threshold: 0.5;

Flowing text inside a shape

This technique uses two shapes set as shape-outside to flow text within a shape, mimicking the functionality of the shape-inside property. It's implemented in an SVG foreignObject tag so it's scalable. Edit the text and notice how it stays within its bounds.

2

My text

3

My text


20
20

20
21

This div element has a heart-shaped mask.This div element has a heart-shaped mask.This div element has a heart-shaped mask.This div element has a heart-shaped mask.This div element has a heart-shaped mask.This div element has a heart-shaped mask.This div element has a heart- shaped mask.This div element has a heart-shaped mask.

This div element has a heart-shaped mask.This div element has a heart-shaped mask.This div element has a heart-shaped mask.This div element has a heart-shaped mask.This div element has a heart-shaped mask.This div element has a heart-shaped mask.This div element has a heart- shaped mask.This div element has a heart-shaped mask.

{ width: 100%; height: auto; -webkit-mask-image:url(ZoomEffects/mask/heartmask.png) no-repeat center top; -webkit-mask-position:relative; //-webkit-mask-repeat:; //-webkit-mask-attachment:; -webkit-mask-size: contain; } https://css-tricks.com/design-considerations-text-images/