css3弹性盒子(伸缩布局)

2017-08-21  本文已影响0人  _Enco_

display:flex;(块级行内都能使用,弹性盒子不能和浮动一起使用)

display:flex;
justify-content:center;
align-items:center;
flex-direction:colum; //竖着排列
flex-direction:row; //横着排列
flex-wrap:wrap;//换行
flex-wrap:wrap-reverse;

离线缓存

if(navigator.onLine){
  alert('网络连接');
}else{
  alert('网络未连接');
}
window.addEventlistener('online',onlineCallback);
window.addEventlistener('offline',onlineCallback);
CACHE MANIFEST 
#version 1.0 
CACHE:
index.html 
css/mian.css    
NETWORK:
#星号表示除上述文件之外的所有文件都应该下载。
*
<html manifest = 'xxxxx.appcache'>
applicationCache.onupdateready = function (){
  var result = window.confirm("网站有更新,是否更新网页?");
  if(result){
    location.reload();
  }
}
上一篇 下一篇

猜你喜欢

热点阅读