Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Before <a href="https://stackoverflow.com/a/31538886/2190172">the <code>will-change</code> directive</a>, you couldn't do this in the same literal way that you can in other languages. The browser (or at least Webkit) dealt with rendering the page by drawing various layers. It should in theory be intelligent enough to work out the layers for you, but sometimes it was a good idea to force something into its own layer.</p> <p>Sometimes that worked, sometimes it didn't, depending on exactly what's going on.</p> <p>Anyway.</p> <p>In CSS, one way to force something into a layer is to transform it using a 3D transform. A common strategy is to add either:</p> <pre><code>transform: translateZ(0); </code></pre> <p>or the equivalent:</p> <pre><code>transform: translate3d(0,0,0); </code></pre> <p>or the slightly crazy:</p> <pre><code>transform: rotateZ(360deg); </code></pre> <p>or the translate ones combined with:</p> <pre><code>-webkit-backface-visibility: hidden; -webkit-perspective: 1000; </code></pre> <p>if things are flickery.</p> <p>These create a new layer as that's what the spec defines. From <a href="http://www.w3.org/TR/css3-transforms/#transform-property" rel="noreferrer">http://www.w3.org/TR/css3-transforms/#transform-property</a>, </p> <blockquote> <p>"Any value other than ‘none’ for the transform results in the creation of both a stacking context and a containing block."</p> </blockquote> <p>These all need careful testing, and aren't something to just always bung on anything that might need it – sometimes it's better, sometimes it's no different, and sometimes it's worse!</p> <p>Good luck!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload