CSS PROPERTIES
Expand All | Collapse All
CSS AT-RULES
Advertisements

CSS3 backface-visibility Property

Topic: CSS3 Properties ReferencePrev|Next

Description

The backface-visibility CSS property determines whether or not the "back" side of a transformed element is visible when facing the user.

The following table summarizes the usages context and the version history of this property.

Default value: visible
Applies to: Transformable elements
Inherited: No
Animatable: No. See animatable properties.
Version: New in CSS3

Syntax

The syntax of the property is given with:

backface-visibility visible | hidden | initial | inherit

The example below shows the backface-visibility property in action.

.flip-container {
    margin: 50px;
    perspective: 1000px;
    display: inline-block;
}
.flip-container:hover .card {
    transform: rotateY(180deg);
}
.card, .front, .back {
    width: 130px;
    height: 195px;
}
.card {
    position: relative;
    transition: 0.5s all;
    transform-style: preserve-3d;
}
.front, .back {
    position: absolute;
    backface-visibility: hidden;
}
.front {
    z-index: 1;
    transform: rotateY(180deg);
}
.back {
    z-index: 2;
    transform: rotateY(0deg);
}

Note: The backface-visibility property is very useful for creating animations like revolving coin or card flipping, where two different images (i.e. front and back side) are blend together to create better 3D rotation effect.


Property Values

The following table describes the values of this property.

Value Description
visible Specifies that the back face is visible, allowing the front face to be displayed mirrored. This is default value.
hidden Specifies that the back face is not visible, hiding the front face.
initial Sets this property to its default value.
inherit If specified, the associated element takes the computed value of its parent element backface-visibility property.

Browser Compatibility

The backface-visibility property is supported in all major modern browsers.

Browsers Icon

Basic Support—

  • Firefox 10+ -moz-, 16+
  • Google Chrome 12+ -webkit-, 36+
  • Internet Explorer 10+
  • Apple Safari 4+ -webkit-
  • Opera 15+ -o-, 23+ -webkit-

Further Reading

See tutorial on: CSS3 Transitions, CSS3 3D Transforms, CSS3 Animations.

Related properties: perspective, perspective-origin, transform, transform-origin, transform-style, transition.

Advertisements
Bootstrap UI Design Templates Property Marvels - A Leading Real Estate Portal for Premium Properties