Div border is not a straight line after turning in Firefox on Mac

I have a div that has two child divs, one div on the screen and the other vertically perpendicular to the screen.

I'm trying to rotate the div by Y axisabout 30 degrees. keeping it transform-style 3d preserved.

However, in Firefox, the border is not a straight line. Looks like this

This is the whole div

For closer viewing

Closer to viewing

I am using the following code

.holder {
  position: relative;
  top: 0;
  left: 0;
  width: 200px;
  height: 226px;
  perspective: 2000px;
  -moz-perspective: 2000px;
}

.box {
  position: absolute;
  left: 0;
  top: 0;
  width: 200px;
  height: 226px;
  background-color: transparent;

  transform-style: preserve-3d;
  -moz-transform-style: preserve-3d;

  transform: translateZ( -100px ) rotateY(30deg);
  -moz-transform: translateZ( -100px ) rotateY(30deg);

  transition: transform 0.5s;
  -moz-transition: transform 0.5s;
}

.box div {
  position: absolute;
  margin: 0;
  display: block;
 }

.box .front {
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;

    transform: rotateX(0deg) translateZ(10px);
    -moz-transform: rotateX(0deg) translateZ(10px);

    background-color: grey;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.box .left {
    left: 0;
    top: 0;
    bottom: 0;
    width: 20px;

    transform: rotateY(-90deg) translateZ(10px);
    -moz-transform: rotateY(-90deg) translateZ(10px);

    background-color: black;
    background-size: cover;
    background-position: left;
    background-repeat: no-repeat;
}
<div class="holder">
  <div class="box">
    <div class="front"></div>
    <div class="left"></div>
  </div>
</div>
Run codeHide result

Please let me know if I am missing something.

Image link provided in one of the answers:enter image description here

+4
source share
3 answers

I have a job for your link problem .

filter div, class="box".

svg, .

filter: url('data:image/svg+xml;utf8,<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><filter id="gaussian_blur"><feGaussianBlur in="SourceGraphic" stdDeviation="0" /></filter></defs></svg>#gaussian_blur');

Opera, FF Chrome Mac Windows.

+2

Firefox,

outline: 1px solid transparent;

.box .front.

+4

, translateZ FF.

outline: 1px solid transparent; , border: 1px solid transparent; .box , transform: rotateX(0deg) translateZ(10px); .box .front.

:

.holder {
  position: relative;
  top: 0;
  left: 0;
  width: 200px;
  height: 226px;
  perspective: 2000px;
  -moz-perspective: 2000px;
}

.box {
  position: absolute;
  left: 0;
  top: 0;
  width: 200px;
  height: 226px;
  background-color: transparent;

  border: 1px solid transparent;

  transform-style: preserve-3d;
  -moz-transform-style: preserve-3d;

  transform: translateZ( -100px ) rotateY(30deg);
  -moz-transform: translateZ( -100px ) rotateY(30deg);

  transition: transform 0.5s;
  -moz-transition: transform 0.5s;
}

.box div {
  position: absolute;
  margin: 0;
  display: block;
 }

.box .front {
    left: 0;
    right: -4px;
    top: 0;
    bottom: 0;

    /* transform: rotateX(0deg) translateZ(10px); */
    /* -moz-transform: rotateX(0deg) translateZ(10px); */

    background-color: grey;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.box .left {
    left: 0;
    top: 0;
    bottom: 0;
    width: 20px;

    transform: rotateY(-90deg) translateZ(10px);
    -moz-transform: rotateY(-90deg) translateZ(10px);

    background-color: black;
    background-size: cover;
    background-position: left;
    background-repeat: no-repeat;
}
<div class="holder">
  <div class="box">
    <div class="front"></div>
    <div class="left"></div>
  </div>
</div>
Hide result
+1

Source: https://habr.com/ru/post/1606780/


All Articles