css transform element affects other element which

2019-07-28 05:52发布

div.tp-border-bottom's border hide when div.tp-banner add transform property, if I set div.tp-border-bottom:after element height to 2px then it is visible, all of this in android webview platform

.tp-banner {
    width: 100px;
    height: 60px;
    -webkit-transform: translate(0px, 0px) translateZ(0px);
    transform: translate(0px, 0px) translateZ(0px);    
}
.tp-border-bottom {
    position: relative;
    width: 100px;
    height: 60px;
}
.tp-border-bottom:after {
    content: "";
    position: absolute;
    font-size: 0;
    line-height: 0;
    background-color: #e1e1e1;
    -webkit-transform-origin: 0 0;
    -ms-transform-origin: 0 0;
    transform-origin: 0 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    -webkit-transform-origin: 0 1px;
    -ms-transform-origin: 0 1px;
    transform-origin: 0 1px;
}
.tp-border-scale:after {
    -webkit-transform: scaleY(0.3333);
    -ms-transform: scaleY(0.3333);
    transform: scaleY(0.3333);
}
/*@media only screen and (-webkit-min-device-pixel-ratio: 3) {
  .tp-border-bottom:after {
    -webkit-transform: scaleY(0.3333);
    -ms-transform: scaleY(0.3333);
    transform: scaleY(0.3333);
  }
}*/
<div class="tp-banner"></div>
<div class="tp-border-bottom tp-border-scale"></div>

1条回答
再贱就再见
2楼-- · 2019-07-28 06:38

Try to add this style to all the transformed elements:

-webkit-backface-visibility: hidden;

Taken from similar question CSS3 hover effects make weird impact on other elements in Chrome

查看更多
登录 后发表回答