最近,我關心的是優化我的網站,使其運行順暢。
這些是代碼:
.someThing {
border-radius: 15px;
width: 555px;
height: 347px;
border: 2px solid rgb(29, 30, 32);
...
}
.someThingElse {
border-radius: 15px;
display: none;
position: relative;
animation: fade 0.5s;
...
}
.someThing {
width: 555px;
height: 347px;
border: 2px solid rgb(29, 30, 32);
...
}
.someThingElse {
display: none;
position: relative;
animation: fade 0.5s;
...
}
.someThing, .someThingElse {
border-radius: 15px;
}
這些如此小的差異是否會使網站運行得比以前更順暢?
uj5u.com熱心網友回復:
它沒有太大區別,但是它會減少一些下載位元組。因此,當在客戶端(在您的服務器的瀏覽器中)獲取頁面時,它將被更快地獲取(因為您減少了border-radius的行。
這是微秒的問題,因此您將無法注意到它或無法充分利用它。
為了提高代碼的可讀性,第二個選項很好。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/416924.html
標籤:
下一篇:如何使輸入滑塊不相互重疊?
