• We just launched and are currently in beta. Join us as we build and grow the community.

How To Make Loading Effect Using CSS3

ffaezffaez1267

Humor Alchemist
F Rep
0
0
0
Rep
0
F Vouches
0
0
0
Vouches
0
Posts
159
Likes
44
Bits
2 MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1 300 XP
Good Day!!!

In this tutorial, we are going to learn How To Make Loading Effect Using CSS3. Mostly loading effect is created through Flash Software, but now with the power of CSS we can make the effect even if we will not use the Flash Software.

For this project, you can change any color you want for the loading effect. CSS is now powerfull in terms of animation for your project because you can customize it easily.

Directions:

For CSS - Design and Effect

  1. .loading_style

    span {
  2. display

    :

    inline-block

    ;
  3. vertical-align

    :

    middle

    ;
  4. width

    :

    10px

    ;
  5. height

    :

    10px

    ;
  6. margin

    :

    50px

    auto

    ;
  7. background

    :

    #ff0000

    ;
  8. border-radius

    :

    5px

    ;
  9. -webkit-animation:

    loading_style 0.9s

    infinite

    alternate

    ;
  10. -moz-animation:

    loading_style 0.9s

    infinite

    alternate

    ;
  11. box-shadow

    :

    1px

    1px

    1px

    #444444

    ;
  12. }

  13. .loading_style

    span:

    nth-of-type

    (

    2

    )

    {
  14. background

    :

    #ff0000

    ;
  15. -webkit-animation-delay:

    0.2s

    ;
  16. -moz-animation-delay:

    0.2s

    ;
  17. }

  18. .loading_style

    span:

    nth-of-type

    (

    3

    )

    {
  19. background

    :

    #ff0000

    ;
  20. -webkit-animation-delay:

    0.4s

    ;
  21. -moz-animation-delay:

    0.4s

    ;
  22. }

  23. .loading_style

    span:

    nth-of-type

    (

    4

    )

    {
  24. background

    :

    #ff0000

    ;
  25. -webkit-animation-delay:

    0.6s

    ;
  26. -moz-animation-delay:

    0.6s

    ;
  27. }

  28. .loading_style

    span:

    nth-of-type

    (

    5

    )

    {
  29. background

    :

    #ff0000

    ;
  30. -webkit-animation-delay:

    0.8s

    ;
  31. -moz-animation-delay:

    0.8s

    ;
  32. }

  33. @-webkit-keyframes

    loading_style {
  34. 0%

    {
  35. width

    :

    10px

    ;
  36. height

    :

    10px

    ;
  37. -webkit-transform:

    translateZ(

    0

    )

    ;
  38. }

  39. 100%

    {
  40. width

    :

    24px

    ;
  41. height

    :

    24px

    ;
  42. -webkit-transform:

    translateZ(

    -21px

    )

    ;
  43. }
  44. }

  45. @-moz-keyframes

    loading_style {
  46. 0%

    {
  47. width

    :

    10px

    ;
  48. height

    :

    10px

    ;
  49. -moz-transform:

    translateZ(

    0

    )

    ;
  50. }
  51. 100%

    {
  52. width

    :

    24px

    ;
  53. height

    :

    24px

    ;
  54. -moz-transform:

    translateZ(

    -21px

    )

    ;
  55. }
  56. }

For HTML Code

  1. <table

    >
  2. <tr

    >
  3. <td

    >
  4. <div

    class

    =

    "loading_style"

    >
  5. <span

    ></

    span

    >
  6. <span

    ></

    span

    >
  7. <span

    ></

    span

    >
  8. <span

    ></

    span

    >
  9. <span

    ></

    span

    >
  10. </

    div

    >
  11. </

    td

    >
  12. <td

    width

    =

    "50"

    >
  13. </

    td

    >
  14. <td

    >
  15. <div

    class

    =

    "loading_style2"

    >
  16. <span

    ></

    span

    >
  17. <span

    ></

    span

    >
  18. <span

    ></

    span

    >
  19. <span

    ></

    span

    >
  20. <span

    ></

    span

    >
  21. </

    div

    >
  22. </

    td

    >
  23. <td

    width

    =

    "50"

    >
  24. </

    td

    >
  25. <td

    >
  26. <div

    class

    =

    "loading_style3"

    >
  27. <span

    ></

    span

    >
  28. <span

    ></

    span

    >
  29. <span

    ></

    span

    >
  30. <span

    ></

    span

    >
  31. <span

    ></

    span

    >
  32. </

    div

    >
  33. </

    td

    >
  34. </

    tr

    >
  35. </

    table

    >

For Source Code

  1. <!DOCTYPE html>
  2. <html

    >
  3. <head

    >
  4. <title

    >

    CSS3 Loading Animation</

    title

    >
  5. <link

    rel

    =

    "stylesheet"

    type

    =

    "text/css"

    href

    =

    "style.css"

    >
  6. <link

    rel

    =

    "stylesheet"

    type

    =

    "text/css"

    href

    =

    "style2.css"

    >
  7. <link

    rel

    =

    "stylesheet"

    type

    =

    "text/css"

    href

    =

    "style3.css"

    >
  8. <link

    rel

    =

    "stylesheet"

    type

    =

    "text/css"

    href

    =

    "style4.css"

    >
  9. <link

    rel

    =

    "stylesheet"

    type

    =

    "text/css"

    href

    =

    "style5.css"

    >
  10. </

    head

    >
  11. <body

    >
  12. <table

    >
  13. <tr

    >
  14. <td

    >
  15. <div

    class

    =

    "loading_style"

    >
  16. <span

    ></

    span

    >
  17. <span

    ></

    span

    >
  18. <span

    ></

    span

    >
  19. <span

    ></

    span

    >
  20. <span

    ></

    span

    >
  21. </

    div

    >
  22. </

    td

    >
  23. <td

    width

    =

    "50"

    >
  24. </

    td

    >
  25. <td

    >
  26. <div

    class

    =

    "loading_style2"

    >
  27. <span

    ></

    span

    >
  28. <span

    ></

    span

    >
  29. <span

    ></

    span

    >
  30. <span

    ></

    span

    >
  31. <span

    ></

    span

    >
  32. </

    div

    >
  33. </

    td

    >
  34. <td

    width

    =

    "50"

    >
  35. </

    td

    >
  36. <td

    >
  37. <div

    class

    =

    "loading_style3"

    >
  38. <span

    ></

    span

    >
  39. <span

    ></

    span

    >
  40. <span

    ></

    span

    >
  41. <span

    ></

    span

    >
  42. <span

    ></

    span

    >
  43. </

    div

    >
  44. </

    td

    >
  45. </

    tr

    >
  46. </

    table

    >
  47. </

    body

    >
  48. </

    html

    >

So what can you say about this work? Share your thoughts in the comment section below or email me at [email protected]. Practice Coding. Thank you.

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.

Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:

1. Re-scan downloaded files using your personal virus checker before using it.

2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.


Download
You must upgrade your account or reply in the thread to view hidden text.
 

442,401

317,942

317,951

Top