css中translate函数怎么用

2023-05-26,

这篇文章给大家分享的是有关csstranslate函数怎么用的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。

1、translate允许单独声明平移变换,并独立于transform属性。

2、这在一些典型的用户界面上更好用,而且这样就无需在transform中声明该函数并记住转换函数的确切顺序了。

实例

.wrapper {
  width: 200px;
  height: 200px;
  border: 2px dotted red;
  margin: 20px auto;
}
.wrapper div {
  width: 200px;
  height: 200px;
  line-height: 200px;
  text-align: center;
  background: orange;
  color: #fff;
  -webkit-transform: translate(50px,100px);
  -moz-transform:translate(50px,100px);
  transform: translate(50px,100px);
}

感谢各位的阅读!关于“css中translate函数怎么用”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!

《css中translate函数怎么用.doc》

下载本文的Word格式文档,以方便收藏与打印。