backface-visibility

CSS backface-visibility Property

The backface-visibility is a CSS property which defines whether the back face of an element should be visible or not. The back face of an element is a mirror image of the front. If the element is rotated, you can choose to show the back face of an element to the user or not. Two values specify this property: visible and hidden.

The backface-visibility property is one of the CSS3 properties.

The “visible” value makes the back face visible to the user. The “hidden” value makes the rear face hidden effectively.

类目类目
Initial Valuevisible
Applies toTransformable elements.
InheritedNo.
AnimatableNo.
VersionCSS3
DOM Syntaxobject.style.backfaceVisibility = “hidden”;

Syntax

Syntax

backface-visibility: visible | hidden | initial | inherit;

Example of the backface-visibility property with the “visible” value:

<!DOCTYPE html>
<html>
  <head>
    <title>The title of the document</title>
    <style>
      .element {
        width: 200px;
        height: 200px;
        background: #666;
        color: #eee;
        backface-visibility: visible;
        -webkit-animation: element 2s infinite linear alternate;
        animation: element 2s infinite linear alternate;
      }
      @-webkit-keyframes element {
        to {
          -webkit-transform: rotateY(180deg);
        }
      }
    </style>
  </head>
  <body>
    <h2>Backface-visibility property example</h2>
    <div class="element">
      <h2>Hello world!</h2>
    </div>
  </body>
</html>

Example of the backface-visibility property with the “hidden” value:

<!DOCTYPE html>
<html>
  <head>
    <title>The title of the document</title>
    <style>
      .element {
        width: 200px;
        height: 200px;
        background: #1c87c9;
        color: #8ebf42;
        backface-visibility: hidden;
        -webkit-animation: element 2s infinite linear alternate;
        animation: element 2s infinite linear alternate;
      }
      @-webkit-keyframes element {
        to {
          -webkit-transform: rotateY(180deg);
        }
      }
    </style>
  </head>
  <body>
    <h2>An example with hidden value</h2>
    <div class="element">
      <h2>Hello world!</h2>
    </div>
  </body>
</html>

Values

Values

ValueDescriptionPlay it
visibleThe backface is visible. It is default value.Play it »
hiddenThe backface is not visible.Play it »
initialSets the property to its default value.
inheritInherits the property from its parent element.


请遵守《互联网环境法规》文明发言,欢迎讨论问题
扫码反馈

扫一扫,反馈当前页面

咨询反馈
扫码关注
返回顶部