<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="keywords" content="关键词一,关键词二">
<meta name="description" content="网站描述内容">
<link rel="Shortcut Icon" href="img/favicon.ico">
<title>Document</title>
<link rel="stylesheet" href="https://cdn.bootcss.com/normalize/8.0.0/normalize.css">
<link rel="stylesheet" href="css/common.css">
<!-- PC桌面端 media="大于等于751px"-->
<link media="(min-width: 751px)" rel="stylesheet" href="css/web.css">
<!-- 手机移动端 media="小于等于750px" -->
<link media="(max-width: 750px)" rel="stylesheet" href="css/app.css">
<style media="screen">
/* 写在 common.css 里面 */
* {
margin: 0;
padding: 0;
list-style: none;
line-height: 1.4;
}
a,
a:focus,
a:hover {
text-decoration: none;
}
a {
display: block;
}
img {
max-width: 100%;
}
body {
background-color: #eff2f4;
font-family: "Heiti SC", Helvetica, HelveticaNeue, "microsoft YaHei"
}
div, ul, li {
background: rgba(0, 0, 0, 0.1);
}
html {
overflow-x: hidden;
}
/* 清除浮动 .clearFix */
.clearfix::after {
content: '';
display: block;
clear: both;
}
.clearfix {
zoom: 1;
/* IE 兼容 */
}
/* <!-- jQuery页面加载完成事件 --> */
.loading {
position: fixed;
width: 100%;
height: 100%;
background: #ffcccc;
}
</style>
</head>
<body>
<div class="loading"></div>
56789
<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript">
$(function() {
$(".loading").fadeOut(); // 可以写在JS公共文件里
})
</script>
</body>
</html>
公共样式导入
<div class="header">
<iframe onload="this.height=this.contentWindow.document.body.scrollHeight;" id="footer_iFrm" name="footer_iFrm" src="../common/header.html" frameborder="0" marginwidth="0" marginheight="0" width="100%" scrolling="no" allowtransparency="yes"></iframe>
</div>
iquery-如何让网页在完全加载完后在显示完整页面
$(function() {
$('body').prepend('<div class="loading" style="position:fixed;width:100%;height:100%;background:#ffcccc"></div>').fadeOut();
})
禁止底部出现滚动条?
CSS 禁止滚动条,有4种方法,具体如下:
1、完全隐藏
在<boby>里加入scroll="no",可隐藏滚动条;
<boby scroll="no">
2、在不需要时隐藏
指当浏览器窗口宽度或高度大于页面的宽或高时,不显示滚动条;
反之,则显示;
<boby scroll="auto">
3、样式表方法
在<boby>里加入style="overflow-x:hidden",可隐藏水平滚动条;
加入style="overflow-y:hidden",可隐藏垂直滚动条。
被包含页面里加入
<style>
html { overflow-x:hidden; }
</style>
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
/*
上面是清除各浏览器,样式差异化
下面是自己写的
*/
a,
a:focus,
a:hover {
text-decoration: none;
}
a {
display: block;
}
img {
max-width: 100%;
}
body {
background-color: #eff2f4;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
font-family: Helvetica Neue,
Helvetica,
PingFang SC,
Hiragino Sans GB,
Microsoft YaHei,
Arial,
sans-serif;
}
div,
ul,
li {
background: rgba(0, 0, 0, 0.1);
}
/*
flex布局
*/
.ju_Center {
display: flex;
justify-content: center;
}
.ju_Between {
display: flex;
justify-content: space-between;
}