js实现网站头部导航滚动缩小效果代码

代码语言:html

所属分类:加载滚动

代码描述:js实现网站头部导航滚动缩小效果代码

代码标签: js 网站 头部 导航 缩小

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">



    <style>
        header.smaller {
        	height: 75px;
        }
        
        header.smaller h1#logo {
        	width: 150px;
        	height: 75px;
        	line-height: 55px;
        	font-size: 55px;
        	margin: 0;
        }
        
        header.smaller nav a {
        	line-height: 75px;
        }
        
        *,
        *:before,
        *:after {
        	-webkit-box-sizing: border-box;
        	-moz-box-sizing: border-box;
        	box-sizing: border-box;
        }
        
        body {
        	color: #505050;
        	font-family: "Open Sans", sans-serif;
        	font-weight: 300;
        	font-size: 16px;
        	line-height: 1.8;
        }
        
        h1, h2, h3, h4, h5, h6 {
        	line-height: 1;
        	font-weight: 100;
        	color: #77C7AC;
        }
        
        a {
        	text-decoration: none;
        	color: #fcfcfc;
        	font-weight: 300;
        }
        
        a:hover {
        	color: #3c3c3c;
        }
        
        #wrapper {
        	width: 100%;
        	margin: 0 auto;
        }
        
        #main {
        	background-color: #fff;
        	padding-top: 150px;
          min-height:500px;
        }
        
        .container {
        	width: 80%;
        	margin: 0 auto;
        	padding: 0 30px;
        }
        
        section {
        	padding: 60px 0;
        }
        
        section h1 {
        	font-weight: 700;
        	margin-bottom: 10px;
        }
        
        section p {
        	margin-bottom: 30px;
        }
        
        section p:last-child {
        	margin-bottom: 0;
        }
        
        section.color {
        	background-color: #f4f4f4;
        }
        
        header {
        	width: 100%;
        	height: 10em;
        	overflow: hidden;
        	position: fixed;
        	top: 0;
        	left: 0;
        	z-index: 999;
          border-bottom:solid 0.5em #f4f4f4;
        	background-color: #394e63;
        .........完整代码请登录后点击上方下载按钮下载查看

网友评论0