将footer固定在页面底部的实现方法,附实例

方法1:footer高度固定+绝对定位

<style>
html{height:100%;}
body{min-height:100%;margin:0;padding:0;position:relative;}
header{background-color: #ffe4c4;}
main{padding-bottom:100px;background-color: #bdb76b;}/* main的padding-bottom值要等于或大于footer的height值 */
footer{position:absolute;bottom:0;width:100%;height:100px;background-color: #ffc0cb;}
</style>

<body>
    <header>header</header>
    <main>content</main>
    <footer>footer</footer>
</body>

test1实例 继续阅读“将footer固定在页面底部的实现方法,附实例”

Android安卓平台上网页WebView中全屏横屏播放html5视频的实现

可以实现在WebView中全屏横屏播放html5视频,但是没办法播放的时候直接进入全屏,因为监听不到播放事件。如果有兴趣可以考虑使用点击事件的监听来曲线救国。

继续阅读“Android安卓平台上网页WebView中全屏横屏播放html5视频的实现”

微信公众号上运行的前端代码精简压缩,优化加载速度,提升用户体验——grunt+requireJS

背景:
1. grunt编译压缩,requireJS加载
2. css编译压缩成单独的min.css文件,大小:384kb
3. js编译压缩成单独的min.js文件,大小:562kb
4. 调用了第三方统计JS 继续阅读“微信公众号上运行的前端代码精简压缩,优化加载速度,提升用户体验——grunt+requireJS”