简体   繁体   中英

Javascript inline style 'webkitTransform' with safari

when i use inline JavaScript to insert style.

eg. document.querSelector('.test').style.color = 'red';

when i did for transform down below;

webkitTransform: 'translate(-50%, -50%)',
MozTransform: 'translate(-50%, -50%)',
msTransform: 'translate(-50%, -50%)',
OTransform: 'translate(-50%, -50%)',
transform: 'translate(-50%, -50%)',

output inline css: (why webkite-transform is missing the '-'?)

webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
-o-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
min-width: inherit;

any reason why this is happening?

Webkit need to be upcase :)

W ebkitTransform: 'translate(-50%, -50%)'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM