<address id="ttjl9"></address>

      <noframes id="ttjl9"><address id="ttjl9"><nobr id="ttjl9"></nobr></address>
      <form id="ttjl9"></form>
        <em id="ttjl9"><span id="ttjl9"></span></em>
        <address id="ttjl9"></address>

          <noframes id="ttjl9"><form id="ttjl9"></form>

          css簡單樣式(旋轉正方形、紙片旋轉、輪播圖3D、簡單輪播圖)

          2021-6-10    前端達人

           
          
          1. 旋轉正方形
          2. <!DOCTYPE html>
          3. <html>
          4. <head>
          5. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
          6. <meta charset="utf-8">
          7. <title>旋轉立方體</title>
          8. <style type="text/css">
          9. .stage{
          10. position: relative;
          11. perspective: 800px;
          12. }
          13. @keyframes rotate-frame{ /* 設置動畫效果 */
          14. 0% {
          15. transform: rotateX(0deg) rotateY(0deg);
          16. }
          17. 50% {
          18. transform: rotateX(360deg) rotateY(0deg);
          19. }
          20. 100% {
          21. transform: rotateX(360deg) rotateY(360deg);
          22. }
          23. }
          24. .container{
          25. width: 450px;
          26. height: 450px;
          27. margin: 0 auto;
          28. transform-style:preserve-3d;
          29. animation: rotate-frame 8s infinite linear;
          30. animation-timing-function: all;
          31. animation-direction: normal;
          32. animation-fill-mode: backwards;
          33. transform-origin: 50% 50% 75px;
          34. /*background: yellow; 容器屏幕背景色*/
          35. }
          36. .container:hover{
          37. /*覆蓋時暫停動畫*/
          38. animation-play-state: paused;
          39. }
          40. .side{
          41. width: 150px;
          42. height: 150px;
          43. position: absolute;
          44. text-align: center;
          45. line-height: 150px;
          46. font-size: 50px;
          47. }
          48. .top{
          49. left: 150px;
          50. top: 0;
          51. transform: rotateX(-90deg); /* 設置角度 */
          52. transform-origin: bottom;
          53. background-color: rgba(0,0,255,0.5);
          54. }
          55. .bottom{
          56. left: 150px;
          57. top: 300px;
          58. transform: rotateX(90deg);
          59. transform-origin: top;
          60. background-color: rgba(0,255,0,0.5);
          61. }
          62. .left{
          63. left: 0;
          64. top: 150px;
          65. transform: rotateY(90deg);
          66. transform-origin: right;
          67. background-color: rgba(255,0,0,0.5);
          68. }
          69. .right{
          70. left: 300px;
          71. top: 150px;
          72. transform: rotateY(-90deg);
          73. transform-origin: left;
          74. background-color: rgba(0,0,100,0.5);
          75. }
          76. .front{
          77. left: 150px;
          78. top: 150px;
          79. transform: translateZ(150px);
          80. background-color: rgba(0,100,0,0.5);
          81. }
          82. .back{
          83. left: 150px;
          84. top: 150px;
          85. background-color: rgba(100,0,0,0.5);
          86. }
          87. .rotateX180{
          88. /*讓倒置的數字倒置回正常狀態*/
          89. transform: rotateX(180deg);
          90. }
          91. </style>
          92. </head>
          93. <body>
          94. <div class="stage">
          95. <div class="container">
          96. <div class="side top" >1</div>
          97. <div class="side bottom">2</div>
          98. <div class="side left">3</div>
          99. <div class="side right">4</div>
          100. <div class="side front">5</div>
          101. <div class="side back">6</div>
          102. </div>
          103. </div>
          104. </body>
          105. </html>
           
          
          1. 紙片旋轉
          2. <!DOCTYPE html>
          3. <html lang="en">
          4. <head>
          5. <meta charset="UTF-8">
          6. <title>Document</title>
          7. <style type="text/css">
          8. .zpbox{
          9. /*設置3D視角*/
          10. perspective: 800px;
          11. perspective-origin: bottom right;
          12. }
          13. .box{
          14. height: 200px;
          15. width: 100px;
          16. margin: 50px auto;
          17. /*preserve-3d 指定子元素定位在三維空間內 */
          18. transform-style: preserve-3d;
          19. /*指定變換為:linear-線性過渡*/
          20. transition-timing-function:linear;
          21. /*指定旋轉動畫*/
          22. animation-name: action_b1;
          23. animation-duration: 4s;
          24. animation-timing-function: all;
          25. animation-direction: normal;
          26. animation-iteration-count: infinite;
          27. animation-fill-mode: backwards;
          28. position: relative;
          29. }
          30. .box:hover{
          31. /*覆蓋時暫停動畫*/
          32. animation-play-state: paused;
          33. }
          34. .b1{
          35. /*聲明第一個卡片為浮動,使得兩個卡片能重疊*/
          36. float: left;
          37. height: 200px;
          38. width: 100px;
          39. background-color: #000;
          40. text-align:center;
          41. line-height: 100px;
          42. color: #fff;
          43. font-size:50px;
          44. }
          45. .b2{
          46. height: 200px;
          47. width: 100px;
          48. background-color: #000;
          49. text-align:center;
          50. line-height: 100px;
          51. color: #fff;
          52. font-size:50px;
          53. /*第二個卡片旋轉90度*/
          54. transform: rotateX(90deg);
          55. /*第二個卡片位于中間位置*/
          56. position: absolute;
          57. margin-left: 0;
          58. margin-top: 0;
          59. }
          60. .rotateX180{
          61. /*讓倒置的2、4數字倒置回正常狀態*/
          62. transform: rotateX(180deg);
          63. }
          64. @keyframes action_b1{
          65. 100%{
          66. transform: rotateX(-360deg);
          67. }
          68. }
          69. </style>
          70. </head>
          71. <body>
          72. <div class="zpbox">
          73. <div class="box">
          74. <div class="b1">
          75. <div>1</div>
          76. <div class="rotateX180">3</div>
          77. </div>
          78. <div class="b2">
          79. <div>2</div>
          80. <div class="rotateX180">4</div>
          81. </div>
          82. </div>
          83. </div>
          84. </body>
          85. </html>
           
          
          1. 輪播圖3D
          2. <!DOCTYPE html>
          3. <html lang="en">
          4. <head>
          5. <meta charset="UTF-8">
          6. <title>Document</title>
          7. <style type="text/css">
          8. html, body, ul, li, ol, dl, dd, dt, p, h1, h2, h3, h4, h5, h6, form, fieldset, legend, img { margin:0; padding:0; } /*去掉多余的像素*/
          9. body{
          10. perspective: 800px;
          11. }
          12. .box{
          13. width: 800px;
          14. height: 360px;
          15. margin: 100px auto;
          16. text-align:center;
          17. position: relative;
          18. left: 50%;
          19. margin-left: -400px;
          20. /*background-color: #eee;*/
          21. transform-style: preserve-3d; /*設置為3D模式*/
          22. /*transform: rotateY(-30deg) rotateX(57deg);*/
          23. /*transition:5s ease;*/
          24. animation-name: animate;
          25. animation-duration: 10s;
          26. animation-iteration-count: infinite;
          27. }
          28. .box>div{
          29. width: 800px;
          30. height: 360px;
          31. position: absolute;
          32. }
          33. .box>.up{
          34. background: url(flower.jpg); /*引入照片*/
          35. transform: rotateX(90deg) translateZ(180px); /* 設置角度 */
          36. }
          37. .box>.down{
          38. background: url(flower.jpg);
          39. transform: rotateX(90deg) rotateZ(180deg)translateZ(-180px);
          40. }
          41. .box>.before{
          42. background: url(flower.jpg);
          43. transform: translateZ(180px);
          44. }
          45. .box>.after{
          46. background: url(flower.jpg);
          47. transform: translateZ(-180px) rotateX(180deg);
          48. }
          49. .box:hover{
          50. animation-play-state: paused; /* 當鼠標懸停的時候停止 */
          51. }
          52. @keyframes animate{
          53. 0%{
          54. }
          55. 25%{
          56. transform: rotateX(90deg);
          57. }
          58. 50%{
          59. transform: rotateX(180deg);
          60. }
          61. 75%{
          62. transform: rotateX(270deg);
          63. }
          64. 100%{
          65. transform: rotateX(360deg);
          66. }
          67. </style>
          68. </head>
          69. <body>
          70. <div class="box">
          71. <div class="up"></div>
          72. <div class="down"></div>
          73. <div class="before"></div>
          74. <div class="after"></div>
          75. </div>
          76. </body>
          77. </html>
            
          
          1. 輪播
          2. <!DOCTYPE html>
          3. <html lang="en">
          4. <head>
          5. <meta charset="UTF-8">
          6. <title>輪播</title>
          7. <style>
          8. .frame{
          9. position:absolute;
          10. margin: 50px 200px;
          11. width:280px;
          12. height:200px;
          13. overflow:hidden;
          14. border-radius:6px;
          15. background-color: #000;
          16. }
          17. .imgdiv img{
          18. float:left;
          19. width:280px;
          20. height:200px;
          21. }
          22. .imgdiv {
          23. position: absolute;
          24. width: 1500px;
          25. }
          26. .play{
          27. animation: lbt 10s ;
          28. animation-direction: normal;
          29. animation-iteration-count: infinite;
          30. }
          31. .play:hover{
          32. animation-play-state: paused;
          33. }
          34. @keyframes lbt {
          35. 0%,20% {
          36. margin-left: 0px;
          37. }
          38. 20%,40% {
          39. margin-left: -300px;
          40. }
          41. 40%,60% {
          42. margin-left: -600px;
          43. }
          44. 60%,80% {
          45. margin-left: -900px;
          46. }
          47. 80%,100% {
          48. margin-left: -1200px;
          49. }
          50. }
          51. </style>
          52. </head>
          53. <body>
          54. <div class="frame" >
          55. <div class="imgdiv play">
          56. <img src="lunbo.jpg" > <!-- 引入照片 -->
          57. <img src="lunbo.jpg" >
          58. <img src="lunbo.jpg" >
          59. <img src="lunbo.jpg" >
          60. <img src="lunbo.jpg" >
          61. </div>
          62. </div>
          63. </body>
          64. </html>

          1

          藍藍設計建立了UI設計分享群,每天會分享國內外的一些優秀設計,如果有興趣的話,可以進入一起成長學習,請掃碼藍小助,報下信息,藍小助會請您入群。歡迎您加入噢~~希望得到建議咨詢、商務合作,也請與我們聯系。

          截屏2021-05-13 上午11.41.03.png


          部分借鑒自:csdn  

          原文鏈接:

          分享此文一切功德,皆悉回向給文章原作者及眾讀者.
          免責聲明:藍藍設計尊重原作者,文章的版權歸原作者。如涉及版權問題,請及時與我們取得聯系,我們立即更正或刪除。

          藍藍設計www.syprn.cn )是一家專注而深入的界面設計公司,為期望卓越的國內外企業提供卓越的UI界面設計、BS界面設計 、 cs界面設計 、 ipad界面設計 、 包裝設計 、 圖標定制 、 用戶體驗 、交互設計、 網站建設 、平面設計服務

          日歷

          鏈接

          個人資料

          藍藍設計的小編 http://www.syprn.cn

          存檔

          亚洲va欧美va天堂v国产综合