我正在使用负边距来将我的图像放在背景上,但是当我缩放到很多时它会移动并扭曲图像到很多.在缩放时,由于负边距,右侧的框朝向顶部.
请在下面找到我正在使用的代码: -
CSS:
.platform-row { -webkit-transform: translateZ(0); -moz-transform: translateZ(0); -ms-transform: translateZ(0); -o-transform: translateZ(0); transform: translateZ(0); margin-top: -530px; margin-left: 700px; } .platform-row .platform-row-box { color: white; font-size: 14px; margin: 0 auto; width: 181px; opacity: .8; margin-top: -170px; position: fixed; } @media screen and (max-width: 640px) { .platform-row { padding-right: 55%; } } @media screen and (max-width: 479px) { .platform-row { margin-top: 40px; padding-right: 35%; } } .platform-icon { -webkit-transition: opacity 0.2s; -moz-transition: opacity 0.2s; transition: opacity 0.2s; /**background-image: url("platform_icons-14a66f5cbf10a328f7b38e6070c26e62.png");**/ background-image: url("Home_Get.png"); display: inline-block; height: 25px; width: 25px; margin-right: 0px; opacity: 1; } @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min--moz-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2 / 1), only screen and (min-device-pixel-ratio: 2), only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx) { .platform-icon { background-image: url("platform_icons%402x-dfed2cc115fa8b344e08c9072408095a.png"); background-size: 454px 88px; -webkit-background-size: 454px 88px; } }
编辑:
当我由于负边距而放大太多时会发生这种情况.