0
Website Moblie First nên chọn cách nào để tối ưu tốc độ?
Cách 1:
#set1:before {
position: absolute;
background: url(../img/deco.png);
content: '';
background-size: 100%;
right: -18%;
top: -2vw;
width: 86%;
height: 110vw;
}
@media only screen and (min-width: 768px){
#set1:before {
right: auto;
left: calc(50% - 87px);
top: -34px;
width: 795px;
height: 876px;
}
}
Cách 2:
#set1:before {
position: absolute;
background: url(../img/deco.png);
content: '';
background-size: 100%;
}
@media only screen and (max-width: 767px){
#set1:before {
right: -18%;
top: -2vw;
width: 86%;
height: 110vw;
}
}
@media only screen and (min-width: 768px){
#set1:before {
left: calc(50% - 87px);
top: -34px;
width: 795px;
height: 876px;
}
}
Add a comment
1 ANSWERS
+4
CSS thì liên quan gì đến tốc độ website. 2 cách trên là 2 cách để responsive thôi mà. Nếu website có khách hàng chủ yếu truy cập từ mobile thì responsive từ mobile -> desktop ngược lại website nhắm đế KH sài laptop nhiều thì ngược lại.
Muốn cải thiện tốc độ load website thì bạn tìm hiểu mấy cái như là: tối ưu hình ảnh(định dạng phù hợp, nhẹ), lazy load hình ảnh, nén file css, js, cache, ...
Xem hướng dẫn tối ưu của google trên.
This comment has been deleted
@pcm cảm ơn bác!!