Logo

Hotline: 0842 272 868

Đc: 1039/11/48 Kp2, P. Tân Hiệp, Tp. Biên Hòa, T. Đồng Nai
Kinh doanh: congnghecit@gmail.com - Hỗ trợ: hotro@congnghecit.com
  • Trang chủ
  • Giới thiệu
  • Dịch vụ
    • Dịch vụ SEO
    • Thiết kế logo
    • Thiết kế website
    • Content marketing
    • Dịch vụ Quảng cáo online
    • Giải pháp cho doanh nghiệp
    • Phần mềm SMS marketing, Gửi tin nhắn hàng loạt
    • Phần mềm quét thông tin nghiệp
  • Dự án hoàn thành
    • Dự án SEO
    • Thiết kế logo
    • Thiết kế website
  • Kiến thức
    • SEO/SEM
    • Thuật toán
    • Quản trị mạng
    • Bảo mật – CEH
    • Tin thiết kế
    • Thiết kế website
    • Content Marketing
    • Social Media Marketing
    • Viết lên cuộc sống
  • Đào tạo
    • Thiết kế đồ họa tại Biên Hòa
    • Học SEO tại Biên Hòa
  • Liên hệ
Logo
  • Trang chủ
  • Giới thiệu
  • Dịch vụ
    • Dịch vụ SEO
    • Thiết kế logo
    • Thiết kế website
    • Content marketing
    • Dịch vụ Quảng cáo online
    • Giải pháp cho doanh nghiệp
    • Phần mềm SMS marketing, Gửi tin nhắn hàng loạt
    • Phần mềm quét thông tin nghiệp
  • Dự án hoàn thành
    • Dự án SEO
    • Thiết kế logo
    • Thiết kế website
  • Kiến thức
    • SEO/SEM
    • Thuật toán
    • Quản trị mạng
    • Bảo mật – CEH
    • Tin thiết kế
    • Thiết kế website
    • Content Marketing
    • Social Media Marketing
    • Viết lên cuộc sống
  • Đào tạo
    • Thiết kế đồ họa tại Biên Hòa
    • Học SEO tại Biên Hòa
  • Liên hệ
Trang chủTin thiết kế websiteHiệu Ứng Loading CSS3

Hiệu Ứng Loading CSS3

Hiệu Ứng Loading CSS3

Tạo hiệu ứng loading bằng CSS3
Trong bài viết này mình sẽ hướng dẫn các bạn cách tạo ra hiệu ứng loading trong trang mà không sử dụng bất kỳ hình động nào. Mình nghĩ nó sẽ thật sự gây ấn tượng cho bạn trong việc giảm số lượng hình ảnh trong các trang web hoặc blog của bạn. Để có thêm nhiều sự lựa chọn,mình sẽ giới thiệu với các bạn 3 hiệu ứng loading khác nhau(xem demo tại đây). Các bạn  làm theo từng bước nha.
Bước 1 : HTML
trong bước này chúng ta sẽ tạo ra 3 phần tử chứa 3 hiệu ứng loading khác nhau

01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<div class="main_body">
    <div class="element">
        <div class="loading1">
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
        </div>
    </div>
    <div class="element">
        <div class="loading2">
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
        </div>
    </div>
    <div class="element">
        <div class="loading3">
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
        </div>
    </div>
</div>

Bước 2 : CSS
Đây là bước hấp dẫn nhất, mình sẽ giới thiệu cho các bạn từng hiệu ứng loading bằng cách áp dụng css cho từng phần tử, đầu tiên chúng ta sẽ tìm hiểu đoạn css cho cái đầu tiên

Tạo hiệu ứng loading bằng CSS3

001
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
017
018
019
020
021
022
023
024
025
026
027
028
029
030
031
032
033
034
035
036
037
038
039
040
041
042
043
044
045
046
047
048
049
050
051
052
053
054
055
056
057
058
059
060
061
062
063
064
065
066
067
068
069
070
071
072
073
074
075
076
077
078
079
080
081
082
083
084
085
086
087
088
089
090
091
092
093
094
095
096
097
098
099
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
.loading1 {
height:100px;
position:relative;
width:80px;
}
.loading1 > div {
background-color:#FFFFFF;
height:30px;
position:absolute;
width:12px;
/* css3 radius */
-moz-border-radius:5px;
-webkit-border-radius:5px;
border-radius:5px;
/* css3 transform - scale */
-webkit-transform:scale(0.4);
-moz-transform:scale(0.4);
-o-transform:scale(0.4);
/* css3 animation */
-webkit-animation-name:loading1;
-webkit-animation-duration:1.04s;
-webkit-animation-iteration-count:infinite;
-webkit-animation-direction:linear;
-moz-animation-name:loading1;
-moz-animation-duration:1.04s;
-moz-animation-iteration-count:infinite;
-moz-animation-direction:linear;
-o-animation-name:loading1;
-o-animation-duration:1.04s;
-o-animation-iteration-count:infinite;
-o-animation-direction:linear;
}
.loading1 > div:nth-child(1) {
left:0;
top:36px;
/* css3 transform - rotate */
-webkit-transform:rotate(-90deg);
-moz-transform:rotate(-90deg);
-o-transform:rotate(-90deg);
/* css3 animation */
-webkit-animation-delay:0.39s;
-moz-animation-delay:0.39s;
-o-animation-delay:0.39s;
}
.loading1 > div:nth-child(2) {
left:10px;
top:13px;
/* css3 transform - rotate */
-webkit-transform:rotate(-45deg);
-moz-transform:rotate(-45deg);
-o-transform:rotate(-45deg);
/* css3 animation */
-webkit-animation-delay:0.52s;
-moz-animation-delay:0.52s;
-o-animation-delay:0.52s;
}
.loading1 > div:nth-child(3) {
left:34px;
top:4px;
/* css3 transform - rotate */
-webkit-transform:rotate(0deg);
-moz-transform:rotate(0deg);
-o-transform:rotate(0deg);
/* css3 animation */
-webkit-animation-delay:0.65s;
-moz-animation-delay:0.65s;
-o-animation-delay:0.65s;
}
.loading1 > div:nth-child(4) {
right:10px;
top:13px;
/* css3 transform - rotate */
-webkit-transform:rotate(45deg);
-moz-transform:rotate(45deg);
-o-transform:rotate(45deg);
/* css3 animation */
-webkit-animation-delay:0.78s;
-moz-animation-delay:0.78s;
-o-animation-delay:0.78s;
}
.loading1 > div:nth-child(5) {
right:0;
top:36px;
/* css3 transform - rotate */
-webkit-transform:rotate(90deg);
-moz-transform:rotate(90deg);
-o-transform:rotate(90deg);
/* css3 animation */
-webkit-animation-delay:0.91s;
-moz-animation-delay:0.91s;
-o-animation-delay:0.91s;
}
.loading1 > div:nth-child(6) {
right:10px;
bottom:9px;
/* css3 transform - rotate */
-webkit-transform:rotate(135deg);
-moz-transform:rotate(135deg);
-o-transform:rotate(135deg);
/* css3 animation */
-webkit-animation-delay:1.04s;
-moz-animation-delay:1.04s;
-o-animation-delay:1.04s;
}
.loading1 > div:nth-child(7) {
bottom:0;
left:34px;
/* css3 transform - rotate */
-webkit-transform:rotate(180deg);
-moz-transform:rotate(180deg);
-o-transform:rotate(180deg);
/* css3 animation */
-webkit-animation-delay:1.17s;
-moz-animation-delay:1.17s;
-o-animation-delay:1.17s;
}
.loading1 > div:nth-child(8) {
left:10px;
bottom:9px;
/* css3 transform - rotate */
-webkit-transform:rotate(-135deg);
-moz-transform:rotate(-135deg);
-o-transform:rotate(-135deg);
/* css3 animation */
-webkit-animation-delay:1.3s;
-moz-animation-delay:1.3s;
-o-animation-delay:1.3s;
}
/* css3 keyframes - loading1 */
@-webkit-keyframes loading1 {
0%{ background-color:#000000 }
100%{ background-color:#FFFFFF }
}
@-moz-keyframes loading1 {
0%{ background-color:#000000 }
100%{ background-color:#FFFFFF }
}
@-o-keyframes loading1 {
0%{ background-color:#000000 }
100%{ background-color:#FFFFFF }
}

Như các bạn đã thấy , ở đây mình sử dụng keyframes, mõi bước (điểm) được chia cắt bởi nhiều độ trễ khác nhau, nào bây giờ chúng ta sẽ tham khảo cho hiệu ứng loading thứ 2

Tạo hiệu ứng loading bằng CSS3

001
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
017
018
019
020
021
022
023
024
025
026
027
028
029
030
031
032
033
034
035
036
037
038
039
040
041
042
043
044
045
046
047
048
049
050
051
052
053
054
055
056
057
058
059
060
061
062
063
064
065
066
067
068
069
070
071
072
073
074
075
076
077
078
079
080
081
082
083
084
085
086
087
088
089
090
091
092
093
094
095
096
097
098
099
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
.loading2 {
height:140px;
position:relative;
width:140px;
/* css3 transform - scale */
-webkit-transform:scale(0.6);
-moz-transform:scale(0.6);
-o-transform:scale(0.6);
}
.loading2 > div {
background-color:#FFFFFF;
height:25px;
position:absolute;
width:25px;
/* css3 radius */
-moz-border-radius:15px;
-webkit-border-radius:15px;
border-radius:15px;
/* css3 animation */
-webkit-animation-name:loading2;
-webkit-animation-duration:1.04s;
-webkit-animation-iteration-count:infinite;
-webkit-animation-direction:linear;
-moz-animation-name:loading2;
-moz-animation-duration:1.04s;
-moz-animation-iteration-count:infinite;
-moz-animation-direction:linear;
-o-animation-name:loading2;
-o-animation-duration:1.04s;
-o-animation-iteration-count:infinite;
-o-animation-direction:linear;
}
.loading2 > div:nth-child(1) {
left:0;
top:57px;
/* css3 animation */
-webkit-animation-delay:0.39s;
-moz-animation-delay:0.39s;
-o-animation-delay:0.39s;
}
.loading2 > div:nth-child(2) {
left:17px;
top:17px;
/* css3 animation */
-webkit-animation-delay:0.52s;
-moz-animation-delay:0.52s;
-o-animation-delay:0.52s;
}
.loading2 > div:nth-child(3) {
left:57px;
top:0;
/* css3 animation */
-webkit-animation-delay:0.65s;
-moz-animation-delay:0.65s;
-o-animation-delay:0.65s;
}
.loading2 > div:nth-child(4) {
right:17px;
top:17px;
/* css3 animation */
-webkit-animation-delay:0.78s;
-moz-animation-delay:0.78s;
-o-animation-delay:0.78s;
}
.loading2 > div:nth-child(5) {
right:0;
top:57px;
/* css3 animation */
-webkit-animation-delay:0.91s;
-moz-animation-delay:0.91s;
-o-animation-delay:0.91s;
}
.loading2 > div:nth-child(6) {
right:17px;
bottom:17px;
/* css3 animation */
-webkit-animation-delay:1.04s;
-moz-animation-delay:1.04s;
-o-animation-delay:1.04s;
}
.loading2 > div:nth-child(7) {
left:57px;
bottom:0;
/* css3 animation */
-webkit-animation-delay:1.17s;
-moz-animation-delay:1.17s;
-o-animation-delay:1.17s;
}
.loading2 > div:nth-child(8) {
left:17px;
bottom:17px;
/* css3 animation */
-webkit-animation-delay:1.3s;
-moz-animation-delay:1.3s;
-o-animation-delay:1.3s;
}
/* css3 keyframes - loading2 */
@-webkit-keyframes loading2 {
0%{ background-color:#000000 }
100%{ background-color:#FFFFFF }
}
@-moz-keyframes loading2 {
0%{ background-color:#000000 }
100%{ background-color:#FFFFFF }
}
@-o-keyframes loading2 {
0%{ background-color:#000000 }
100%{ background-color:#FFFFFF }
}

Và cả hiệu ứng loading thứ 3

Tạo hiệu ứng loading bằng CSS3

01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
.loading3 > div {
background-color:#FFFFFF;
border:1px solid #000000;
float:left;
height:114px;
margin-left:5px;
width:30px;
opacity:0.1;
/* css3 transform - scale */
-webkit-transform:scale(0.8);
-moz-transform:scale(0.8);
-o-transform:scale(0.8);
/* css3 animation */
-webkit-animation-name:loading3;
-webkit-animation-duration:1.2s;
-webkit-animation-iteration-count:infinite;
-webkit-animation-direction:linear;
-moz-animation-name:loading3;
-moz-animation-duration:1.2s;
-moz-animation-iteration-count:infinite;
-moz-animation-direction:linear;
-o-animation-name:loading3;
-o-animation-duration:1.2s;
-o-animation-iteration-count:infinite;
-o-animation-direction:linear;
}
.loading3 > div:nth-child(1) {
/* css3 animation */
-webkit-animation-delay:0.24s;
-moz-animation-delay:0.24s;
-o-animation-delay:0.24s;
}
.loading3 > div:nth-child(2) {
/* css3 animation */
-webkit-animation-delay:0.48s;
-moz-animation-delay:0.48s;
-o-animation-delay:0.48s;
}
.loading3 > div:nth-child(3) {
/* css3 animation */
-webkit-animation-delay:0.72s;
-moz-animation-delay:0.72s;
-o-animation-delay:0.72s;
}
.loading3 > div:nth-child(4) {
/* css3 animation */
-webkit-animation-delay:0.96s;
-moz-animation-delay:0.96s;
-o-animation-delay:0.96s;
}
.loading3 > div:nth-child(5) {
/* css3 animation */
-webkit-animation-delay:1.2s;
-moz-animation-delay:1.2s;
-o-animation-delay:1.2s;
}
/* css3 keyframes - loading3 */
@-webkit-keyframes loading3 {
0% {
-webkit-transform:scale(1.2);
opacity:1;
}
100% {
-webkit-transform:scale(0.7);
opacity:0.1;
}
}
@-moz-keyframes loading3 {
0% {
-moz-transform:scale(1.2);
opacity:1;
}
100% {
-moz-transform:scale(0.7);
opacity:0.1;
}
}
@-o-keyframes loading3 {
0% {
-o-transform:scale(1.2);
opacity:1;
}
100% {
-o-transform:scale(0.7);
opacity:0.1;
}
}

Mình hy vọng các bạn sẽ thấy thích với kết quả mà các bạn đã làm được. Chúc các bạn thành công !

Hiệu Ứng Loading CSS3
Đánh giá

Banner-CIT

Hotline: 0842 272 868 – 0922 272 868 – 0977 373 471
Đc: 1039/11/48 Kp2, P. Tân Hiệp, Tp. Biên Hòa, T. Đồng Nai
Email: congnghecit@gmail.com    –    hotro@congnghecit.com
Website: https://congnghecit.com – http://congnghecit.net – http://congnghecit.vn

88 Lượt xem 2017-01-10 10:53
seo gia re,

Tin mới

Cách lựa chọn logo phù hợp cho doanh nghiệp

29/05/2018

Những điều cần chú ý khi thiết kế bao bì giúp tiết kiệm chi phí sản xuất

10/02/2019

Thế nào thiết kế logo đẹp?

29/05/2018

Những vai trò của bộ nhận diện thương hiệu

29/05/2018

7 cách đặt tên công ty phổ biến nhất

28/05/2018

Bao bì sản phẩm có gì để bạn quan tâm?

29/05/2018

Làm sao để tái thiết kế thương hiệu sáng suốt ?

28/05/2018

5 Thời điểm thích hợp để doanh nghiệp đổi tên thương hiệu

29/05/2018

Branding, Marketing, Quảng cáo, PR khác nhau như thế nào?

28/05/2018

Những dự án thiết kế thương hiệu tiêu biểu

29/05/2018

Mở rộng thương hiệu là gì? Cách quản lý chiến lược mở rộng thương hiệu

29/05/2018

Case study: Thiết kế Logo, Website, Profile và Bộ nhận diện thương hiệu Tập đoàn VIDEC

28/05/2018

Những xu hướng thiết kế bao bì mới nhất

29/05/2018

20 Logo nổi tiếng với những thông điệp ẩn thú vị

29/05/2018

5 lưu ý khi thiết kế Website giúp tăng tốc doanh thu trong mùa lễ Tết

16/01/2019

Bài học thiết kế logo từ những thương hiệu lớn

29/05/2018

Tính cách thương hiệu là gì? Làm thế nào để xác định tính cách thương hiệu?

29/05/2018

Bạn không nên tự thiết kế bao bì sản phẩm?

28/05/2018

5 Bí quyết độc đáo thiết kế bao bì dược phẩm

29/05/2018

Doanh nghiệp nhỏ cần thiết kế logo chuyên nghiệp

29/05/2018

11 Bước xây dựng và phát triển thương hiệu doanh nghiệp thành công

28/05/2018

Làm thế nào để tăng nhận biết thương hiệu thông qua bao bì?

09/02/2019

TOP 10 chiến lược xây dựng thương hiệu đỉnh cao

28/05/2018

Kinh nghiệm thiết kế logo ngành du lịch – nghỉ dưỡng

29/05/2018

5 mục tiêu quảng bá thương hiệu phổ biến nhất hiện nay

02/02/2019

Liên hệ

1039/11/48 Kp2, P. Tân Hiệp, Tp. Biên Hòa, T. Đồng Nai

congnghecit.com – congnghecit.net – congnghecit.vn

 0842 272 868 – 0922 272 868 – 0977 373 471

congnghecit@gmail.com

 Zalo: 0977 373 471

Dịch vụ SEO

Webmaster

SEO tổng thể

SEO cơ bản SEO onpage

SEO audit phân tích website

Tư vấn SEO , SEO từ khóa, SEO traffic

Content marketing

Dịch vụ viết bài PR

Dịch vụ chăm sóc Fanpage

Biên tập định hướng nội dung

Phần mềm gửi tin nhắn hàng loạt

Dịch vụ chăm sóc nội dung Website

CÔNG NGHỆ CIT không thiết kế web giá rẻ, chúng tôi thiết kế web chuyên nghiệp với giá hợp lý

Thiết kế Biên Hòa Thiết kế web Biên Hòa Thiết kế website tại Biên Hòa Thiết kế web Đồng Nai Thiết kế website tại Đồng Nai công ty thiết kế web tại Biên Hòa Thiết kế website ở tại Đồng Nai dịch vụ thiết kế website tại biên hòa Thiết kế Logo Thiết kế Biên Hòa Thiết kế Đồng Nai Thiết kế logo Biên Hòa Thiết kế logo Đồng Nai công ty thiet ke logo Dong Nai dịch vụ seo tại biên hòa dịch vụ seo tại đồng nai dich vu seo bien hoa dich vu seo dong nai công ty seo website tại biên hòa dịch vụ seo dịch vụ seo