CSS案例练习-仿幻塔首页

330 阅读1分钟

1.效果

只实现了部分,js特效没做,大概能有八九成相似度

2.初始化样式reset.css

/* 初始化样式 */

* {
    margin: 0;
    padding: 0;
}

li {
    list-style: none;
}

a {
    text-decoration: none;
}

3.index.css

/* 背景 */

.video-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 967px;
    z-index: -1;
}

.video-bg video {
    width: 100%;
    object-fit: cover;
}

.go {
    position: absolute;
    top: 100px;
    left: 400px;
}


/* 头部header start */

.header {
    height: 85px;
    line-height: 85px;
    padding: 0 50px;
    background: rgba(0, 0, 0, 0.3);
}

.header>div {
    float: left;
}

.header .logo {
    width: 119px;
}


/* 导航栏 */

.header .nav {
    margin: 0 230px;
}

.header .nav ul li {
    text-align: center;
    float: left;
}

.header .nav ul li a {
    display: inline-block;
    width: 126px;
    height: 37px;
    line-height: 30px;
    font-size: 22px;
    color: #fff;
    /* background-color: skyblue; */
}

.header .nav ul li:first-child a {
    color: #d5fcb6;
    background: url(/images/nav_on.png) no-repeat;
}

.header .nav ul li span {
    display: inline-block;
    margin: 0 10px;
    color: #fff;
}

.header .nav ul li a:hover {
    color: #d5fcb6;
    background: url(/images/nav_on.png) no-repeat;
}

.header .music {
    margin-top: 10px;
    width: 40px;
    height: 30px;
}

.header .music img {
    width: 100%;
}


/* 头部header end */


/* 底部footer start */

.footer {
    position: absolute;
    bottom: -60px;
    left: 0;
    width: 100%;
    height: 400px;
}

.footer .years {
    position: absolute;
    left: 50px;
    bottom: 95px;
}

.footer .download {
    position: absolute;
    left: 657px;
    bottom: 70px;
    width: 533px;
    height: 182px;
    background: url(/images/down_box.png) no-repeat;
}

.footer .download {
    padding-top: 20px;
}

.footer .download>div {
    float: left;
}


/* 二维码 */

.footer .download .qrcode {
    margin-left: 70px;
    margin-right: 10px;
    width: 120px;
    height: 120px;
}

.footer .download .qrcode img {
    width: 100%;
}


/* 加入我们 */

.us {
    position: absolute;
    top: -100px;
    right: 0;
    width: 29px;
    height: 131px;
}

.us a {
    width: 100%;
}

.us a img {
    width: 100%;
}


/* 底部footer end */