漸進增強
針對低版本瀏覽器進行構建頁面,保證最基本的功能,然后在針對高級瀏覽器進行效果、交互等改進和追加功能達到更好的用戶體驗。
例子:
.box {
? ? -webkit-transition: all 0.5s;
? ? ? ? -moz-transition: all 0.5s;
? ? ? ? ? ? ?-o-transition: all 0.5s;
? ? ? ? ? ? ? ? ?transition: all 0.5s;
}
優雅降級
一開始就構建完整的功能,然后再針對低版本瀏覽器進行兼容。
例子:
.box {
????????????transition: all 0.5s;
????????-o-transition: all 0.5s;
????-moz-transition: all 0.5s;
-webkit-transition: all 0.5s;
}