Introduction

This is a simple application for beginners that shows how to rotate a button using HTML 5 and CSS 3 tools. We know that CSS is the acronym for Cascading Style Sheet that helps to design a form in a web application. CSS has three levels; they are level 1, level 2 and level 3. CSS level 3 is alway used to develop an animated application with the help of HTML 5 tools. CSS 3 provides an advanced module used in web applications that include selectors, box models, 2D, and 3D transformation, animation and user interface.
Step 1: First open an HTML editor such as Notepad.
  • Open start->Notepad.
  • The name of the editor is "Sam".
notepad.gif
    Step 2: Add a Folder on Desktop.
    • Right-click on desktop.
    • new->add folder.
    • The name of the folder is own choice there is "Jeen".
    folder.gif
    Step 3:
    Open Visual Studio.
    • Go to file -> New->Projects.
    • Create an ASP. NET Web Application.
    • Name of "Joy.aspx".
    new application.gif
    openapplication.gif
    Step 4:
    Add an HTML file to your web application.
    • Right-click of Solution Explorer.
    • Add->add new item->HTML form.
    • Name of HTML form is "Rotate.html".
    html.gif
    Step 5:
    Set the properties of a button.
    Code
    1. .button
    2. {
    3. border-style: none;
    4. border-color: inherit;
    5. border-width: medium;
    6. background:#008080;
    7. color:Navy;
    8. font-weight:lighter;
    9. font-size:10px;
    10. padding:40px 15px;
    11. cursor:progress;
    12. txt-transition:-Rot-transform 1s,opacity 1s,background 1s,width 1s,height 1s,font-size 1s
    13. transition-property:width,height,transform,background,font-size,opacity,color;
    14. transition-duration:1s,1s,1s,1s,1s,1s,1s;
    15. transition-property:width, height, txt, background, font-size, opacity, color;
    16. transition-duration:1s,1s,1s,1s,1s,1s,1s;
    17. tran-property:width,height,transform,background,font-size,opacity;
    18. tran-duration:1s,1s,1s,1s,1s,1s;
    19. txt-border-radius:5px;
    20. border-radius:5px;
    21. txt-box-shadow:0 0 2px rgba(0,0,0,0.5);
    22. moz-box-shadow:0 0 2px rgba(0,0,0,0.5);
    23. box-shadow:0 0 2px rgba(0,0,0,0.5);
    24. text-shadow:0 0 5px rgba(255,255,255,0.5);
    25. display:inline-block;
    26. height: 300px;
    27. width: 300px;
    28. }
    Step 6: Set the rotation properties of a button.
    Code :
    1. .clockwise:hover
    2. {
    3. txt: rotate(360deg);
    4. txt-transform: rotate(360deg);
    5. transform: rotate(360deg);
    6. transform: rotate(360deg);
    7. }
    8. .anticlockwise:hover
    9. {
    10. txt: rotate(-360deg);
    11. txt-transform: rotate(-360deg);
    12. transform: rotate(-360deg);
    13. transform: rotate(-360deg);
    14. }
    15. .orange:hover
    16. {
    17. background:#FFB112;
    18. font-size:50px;
    19. color:Fuchsia;
    20. }
    21. .green:hover
    22. {
    23. background:#FFB112;
    24. font-size:50px;
    25. color:Navy;
    26. }
    27. .red:hover
    28. {
    29. background:#D03603;
    30. font-size:50px;
    31. color:Purple;
    32. }
    Step 7: The complete code of the application is a given below:
    Code
    1. <html>
    2. <title>Tom application </title>
    3. <style>
    4. span
    5. {
    6. width:350px;
    7. float:left;
    8. margin:100px 0 0 50px;
    9. height: 200px;
    10. .button
    11. {
    12. border-style: none;
    13. border-color: inherit;
    14. border-width: medium;
    15. background:#008080;
    16. color:Navy;
    17. font-weight:lighter;
    18. font-size:10px;
    19. padding:40px 15px;
    20. cursor:progress;
    21. txt-transition:-Rot-transform 1s,opacity 1s,background 1s,width 1s,height 1s,font-size 1s
    22. transition-property:width,height,transform,background,font-size,opacity,color;
    23. transition-duration:1s,1s,1s,1s,1s,1s,1s;
    24. transition-property:width, height, txt, background, font-size, opacity, color;
    25. transition-duration:1s,1s,1s,1s,1s,1s,1s;
    26. tran-property:width,height,transform,background,font-size,opacity;
    27. tran-duration:1s,1s,1s,1s,1s,1s;
    28. txt-border-radius:5px;
    29. border-radius:5px;
    30. txt-box-shadow:0 0 2px rgba(0,0,0,0.5);
    31. moz-box-shadow:0 0 2px rgba(0,0,0,0.5);
    32. box-shadow:0 0 2px rgba(0,0,0,0.5);
    33. text-shadow:0 0 5px rgba(255,255,255,0.5);
    34. display:inline-block;
    35. height: 300px;
    36. width: 300px;
    37. }
    38. .clockwise:hover
    39. {
    40. txt: rotate(360deg);
    41. txt-transform: rotate(360deg);
    42. transform: rotate(360deg);
    43. transform: rotate(360deg);
    44. }
    45. .anticlockwise:hover
    46. {
    47. txt: rotate(-360deg);
    48. txt-transform: rotate(-360deg);
    49. transform: rotate(-360deg);
    50. transform: rotate(-360deg);
    51. }
    52. .orange:hover
    53. {
    54. background:#FFB112;
    55. font-size:50px;
    56. color:Fuchsia;
    57. }
    58. .green:hover
    59. {
    60. background:#FFB112;
    61. font-size:50px;
    62. color:Navy;
    63. }
    64. .red:hover
    65. {
    66. background:#D03603;
    67. font-size:50px;
    68. color:Purple;
    69. }
    70. </style>
    71. </head>
    72. <body>
    73. <div>
    74. <span>
    75. <a class=" button anticlockwise green" shape="circle">csharpcorner</a>
    76. </span>
    77. <span>
    78. <a class="button clockwise red" shape="poly">MCN Solutions Home Page</a>
    79. </span>
    80. <span>
    81. <a class="button clockwise orange ">MCN professionals</a>
    82. </span>
    83. </div>
    84. </body>undefined</html>
    Step 8: Run application on a browser.
    Output
    out 1.gif
    out1.gif
    out 2.gif
    out3.gif
    Resources