当前位置:Gxlcms > css > css3.0的图形构成

css3.0的图形构成

时间:2021-07-01 10:21:17 帮助过:34人阅读

这篇文章主要介绍了关于css3.0的图形构成,有着一定的参考价值,现在分享给大家,有需要的朋友可以参考一下

css3.0 的出现给我们带来了很大的影响,本文主要知识点 transform属性/animate的应用,感兴趣的朋友可以参考并学习下实例,希望对你学习图形构成有所帮助

主要知识点
① transform属性:
    ratate(旋转度数)
    scale(等比例缩放)
    skew(x , y);让元素倾斜显示,包含两个参数值,分别表示X轴和Y轴倾斜的角度,如果第二个参数为空,则默认为0,参数为负表示向相反方向倾斜。
②animate 适用于鼠标经过产生宽度,高度,left,top等等 示例 transition:1s ease all;所有事件产生动画!

  1. p {
  2. -webkit-animation-name: pulse;
  3. -webkit-animation-duration: 2s;
  4. -webkit-animation-iteration-count: infinite;
  5. -webkit-animation-timing-function: ease-in-out;
  6. -webkit-animation-direction: alternate;
  7. }@-webkit-keyframes pulse {
  8. from {
  9. opacity: 0.0;
  10. font-size: 100%;
  11. }
  12. to {
  13. opacity: 1.0;
  14. font-size: 200%;
  15. }
  16. }style
  17. *{ margin: 0; padding: 0;}
  18. body {
  19. overflow: hidden;
  20. }
  21. #clouds{
  22. background:-webkit-linear-gradient(top,#c9dbe9 0%,#fff 100%);/*等价于background:-webkit-gradient(linear,left top,left bottom,from(c9dbe9),to(#fff))*/
  23. background:-moz-linear-gradient(top,#c9dbe9 0%,#fff 100%);
  24. background:-o-linear-gradient(top,#c9dbe9 0%,#fff 100%);
  25. padding:100px 0px;
  26. }
  27. .cloud{
  28. width:200px;
  29. height:60px;
  30. background:#FFF;
  31. border-radius:200px;
  32. -webkit-border-radius:200px;
  33. -moz-border-radius:200px;
  34. -o-border-radius:200px;
  35. position:relative;}
  36. .cloud:after,.cloud:before{
  37. content:'';
  38. position:absolute;
  39. background:#FFF;
  40. width:100px;
  41. height:80px;
  42. top:-15px;
  43. left:10px;
  44. border-radius:100px;
  45. -webkit-border-radius:100px;
  46. -moz-border-radius:100px;
  47. -o-border-radius:100px;}
  48. .cloud:after{
  49. width:120px;
  50. height:120px;
  51. top:-55px;
  52. left:auto;
  53. right:15px;}
  54. .x1{
  55. -webkit-animation:moveclouds 25s linear infinite;
  56. -moz-animation:moveclouds 25s linear infinite;
  57. -o-animation:moveclouds 25s linear infinite;}
  58. .x2{
  59. left:200px;
  60. transform:scale(0.6);
  61. -webkit-transform:scale(0.6);
  62. -moz-transform:scale(0.6);
  63. -o-transform:scale(0.6);
  64. opacity:0.6;
  65. animation:moveclouds 25s linear infinite;
  66. -webkit-animation:moveclouds 25s linear infinite;
  67. -moz-animation:moveclouds 25s linear infinite;
  68. -o-animation:moveclouds 25s linear infinite;}
  69. .x3{
  70. top:-200px;
  71. left:-250px;
  72. transform:scale(0.6);
  73. -webkit-transform:scale(0.6);
  74. -moz-transform:scale(0.6);
  75. -o-transform:scale(0.6);
  76. opacity:0.6;
  77. animation:moveclouds 25s linear infinite;
  78. -webkit-animation:moveclouds 25s linear infinite;
  79. -moz-animation:moveclouds 25s linear infinite;
  80. -o-animation:moveclouds 25s linear infinite;}
  81. .x4{
  82. top:200px;
  83. left:470px;
  84. transform:scale(0.6);
  85. -webkit-transform:scale(0.6);
  86. -moz-transform:scale(0.6);
  87. -o-transform:scale(0.6);
  88. opacity:0.6;
  89. animation:moveclouds 25s linear infinite;
  90. -webkit-animation:moveclouds 25s linear infinite;
  91. -moz-animation:moveclouds 25s linear infinite;
  92. -o-animation:moveclouds 25s linear infinite;}
  93. .x5{
  94. left:470px;
  95. top:-250px;
  96. transform:scale(0.8);
  97. -webkit-transform:scale(0.8);
  98. -moz-transform:scale(0.8);
  99. -o-transform:scale(0.8);
  100. opacity:0.8;
  101. animation:moveclouds 25s linear infinite;
  102. -webkit-animation:moveclouds 18s linear infinite;
  103. -moz-animation:moveclouds 18s linear infinite;
  104. -o-animation:moveclouds 18s linear infinite;}
  105. @-webkit-keyframes moveclouds{
  106. 0%{margin-left:1000px;}
  107. 100%{margin-left:-1000px;}
  108. }
  109. @-moz-keyframes moveclouds{
  110. 0%{margin-left:1000px;}
  111. 100%{margin-left:-1000px;}
  112. }
  113. @-o-keyframes moveclouds{
  114. 0%{margin-left:1000px;}
  115. 100%{margin-left:-1000px;}
  116. }
  117. html
  118. <p id="clouds">
  119.   <p class="cloud x1"></p>
  120.   <p class="cloud x2"></p>
  121.   <p class="cloud x3"></p>
  122.   <p class="cloud x4"></p>
  123.   <p class="cloud x5"></p>
  124. </p>

以上就是本文的全部内容,希望对大家的学习有所帮助,更多相关内容请关注PHP中文网!

相关推荐:

CSS3中Transition动画属性的用法介绍

CSS实现网页背景渐变的四种代码设置

以上就是css3.0的图形构成的详细内容,更多请关注Gxl网其它相关文章!

人气教程排行