This chapter will teach you how to mirror an image
The box-reflect property facilitates the generation of an image reflection.
The box-reflect property can take one of the following values: below, above, left, or right.
The figures in the table indicate the earliest browser version that comprehensively supports the property.
Numbers accompanied by -webkit- indicate the initial version that functioned with a prefix.
Example
Here we desire the reflection to appear beneath the image.
img { |
Example
Here we aim for the reflection to be positioned on the right side of the image.
img { -webkit-box-reflect: right; } |
To define the space between the image and its reflection, include the gap size within the box-reflect property.
Example
Here we aim for the reflection to be positioned below the image, with a 20px offset.
img { -webkit-box-reflect: below 20px; } |
img { |