【前端】学成在线项目

HTML结构

<!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">
    <title>学成在线</title>
    <link rel="stylesheet" href="style.css">
</head>

<body>
    <div class="header w">
        <div class="logo">
            <img src="image/logo.png" alt="">
        </div>
        <div class="nav">
            <ul>
                <li><a href="#">首页</a></li>
                <li><a href="#">课程</a></li>
                <li><a href="#">职业规划</a></li>
            </ul>
        </div>
        <div class="search">
            <input type="text" value="输入关键词">
            <button></button>
        </div>
        <div class="user">
            <img src="image/user.png">
            qq-lishui
        </div>
    </div>
    <div class="banner">
        <div class="w">
            <div class="subnav">
                <ul>
                    <li class="one"><a href="#">前端开发<span>&gt;</span></a></li>
                    <li><a href="#">后端开发<span>&gt;</span></a></li>
                    <li><a href="#">移动开发<span>&gt;</span></a></li>
                    <li><a href="#">人工智能<span>&gt;</span></a></li>
                    <li><a href="#">商业预测<span>&gt;</span></a></li>
                    <li><a href="#">云计算&打数据<span>&gt;</span></a></li>
                    <li><a href="#">运维&从测试<span>&gt;</span></a></li>
                    <li><a href="#">UI设计<span>&gt;</span></a></li>
                    <li><a href="#">产品<span>&gt;</span></a></li>
                </ul>
            </div>
            <div class="course">
                <h3>我的课程表</h3>
                <div class="bd">
                    <ul>
                        <li>
                            <h4>继续学习 程序语言设计</h4>
                            <p>正在学习-使用对象</p>
                        </li>
                        <li>
                            <h4>继续学习 程序语言设计</h4>
                            <p>正在学习-使用对象</p>
                        </li>
                        <li>
                            <h4>继续学习 程序语言设计</h4>
                            <p>正在学习-使用对象</p>
                        </li>
                    </ul>
                    <a href="#">全部课程</a>
                </div>
            </div>
        </div>
    </div>
    <div class="goods w">
        <h4>精品推荐</h4>
        <ul class="goods-item">
            <li><span>|</span><a href="#">JQuery</a></li>
            <li><span>|</span><a href="#">Spark</a></li>
            <li><span>|</span><a href="#">MySQL</a></li>
            <li><span>|</span><a href="#">JavaWeb</a></li>
            <li><span>|</span><a href="#">MySQL</a></li>
            <li><span>|</span><a href="#">JavaWeb</a></li>
        </ul>
        <a href="#" class="mod">修改兴趣</a>
    </div>
    <div class="box w">
        <div class="box-head">
            <h3>精品推荐</h3>
            <a href="#">查看全部</a>
        </div>
        <div class="box-body w ">
            <ul class="clearfix">
                <li>
                    <a href="#">
                        <img src="image/bd1.png">
                        <h4>Think PHP 5.0 博客系统实战项目演练 </h4>
                        <div class="info">
                            <span>高级</span> · 1125人在学习
                        </div>
                    </a>
                </li>
                <li>
                    <a href="#">
                        <img src="image/bd2.png">
                        <h4>Android 网络图片加载框架详解 </h4>
                        <div class="info">
                            <span>高级</span> · 1125人在学习
                        </div>
                    </a>
                </li>
                <li>
                    <a href="#">
                        <img src="image/bd3.png">
                        <h4>Angular 2 最新框架+主流技术+项目实战 </h4>
                        <div class="info">
                            <span>高级</span> · 1125人在学习
                        </div>
                    </a>
                </li>
                <li>
                    <a href="#">
                        <img src="image/bd4.png">
                        <h4>Android Hybrid APP开发实战 H5+原生 </h4>
                        <div class="info">
                            <span>高级</span> · 1125人在学习
                        </div>
                    </a>
                </li>
                <li class="five">
                    <a href="#">
                        <img src="image/bd5.png">
                        <h4>UGUI源码深度剖析</h4>
                        <div class="info">
                            <span>高级</span> · 1125人在学习
                        </div>
                    </a>
                </li>
                <li>
                    <a href="#">
                        <img src="image/bd6.png">
                        <h4>Kami2首页界面切换效果 </h4>
                        <div class="info">
                            <span>高级</span> · 1125人在学习
                        </div>
                    </a>
                </li>
                <li>
                    <a href="#">
                        <img src="image/bd7.png">
                        <h4>Unity Profiler入门</h4>
                        <div class="info">
                            <span>高级</span> · 1125人在学习
                        </div>
                    </a>
                </li>
                <li>
                    <a href="#">
                        <img src="image/bd8.png">
                        <h4>Cocos2d-x 引擎源码中的纹理优化 </h4>
                        <div class="info">
                            <span>高级</span> · 1125人在学习
                        </div>
                    </a>
                </li>
                <li>
                    <a href="#">
                        <img src="image/bd9.png">
                        <h4>微软人工智能-数据分析平台 </h4>
                        <div class="info">
                            <span>高级</span> · 1125人在学习
                        </div>
                    </a>
                </li>
                <li class="ten">
                    <a href="#">
                        <img src="image/bd2.png">
                        <h4>Android 网络图片加载框架详解 </h4>
                        <div class="info">
                            <span>高级</span> · 1125人在学习
                        </div>
                    </a>
                </li>
            </ul>
        </div>
    </div>
    <div class="box2 w">
        <div class="box2-head">
            <h3>编程入门</h3>
            <ul>
                <li><a href="#">热门</a></li>
                <li><a href="#">初级</a></li>
                <li><a href="#">中级</a></li>
                <li><a href="#">高级</a></li>
            </ul>
            <a href="#">查看全部</a>
        </div>
        <div class="box2-body">
            <div class="body-left">
                <img src="image/bd11.png" alt="">
            </div>
            <div class="body-right">
                <div class="body-right-top">
                    <img src="image/bd12.png" alt="">
                </div>
                <ul>
                    <li>
                        <a href="#">
                            <img src="image/bd4.png">
                            <h4>Android Hybrid APP开发实战 H5+原生 </h4>
                            <div class="info">
                                <span>高级</span> · 1125人在学习
                            </div>
                        </a>
                    </li>
                    <li>
                        <a href="#">
                            <img src="image/bd3.png">
                            <h4>Angular 2 最新框架+主流技术+项目实战 </h4>
                            <div class="info">
                                <span>高级</span> · 1125人在学习
                            </div>
                        </a>
                    </li>
                    <li>
                        <a href="#">
                            <img src="image/bd5.png">
                            <h4>UGUI源码深度剖析 </h4>
                            <div class="info">
                                <span>高级</span> · 1125人在学习
                            </div>
                        </a>
                    </li>
                    <li class="last">
                        <a href="#">
                            <img src="image/bd2.png">
                            <h4>Android 网络图片加载框架详解 </h4>
                            <div class="info">
                                <span>高级</span> · 1125人在学习
                            </div>
                        </a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
    <div class="footer">
        <div class="w">
            <div class="copyright">
                <img src="image/logo.png" alt="">
                <p>学成在线致力于普及中国最好的教育它与中国一流大学和机构合作提供在线课程。<br>
                    © 2017年XTCG Inc.保留所有权利。-沪ICP备15025210号</p>
                <a href="#">下载APP</a>
            </div>
            <div class="link">
                <dl>
                    <dt>关于学成网</dt>
                    <a href="#">
                        <dd>关于</dd>
                    </a>
                    <a href="#">
                        <dd>管理团队</dd>
                    </a>
                    <a href="#">
                        <dd>工作机会</dd>
                    </a>
                    <a href="#">
                        <dd>客户服务</dd>
                    </a>
                    <a href="#">
                        <dd>帮助</dd>
                    </a>
                </dl>
                <dl>
                    <dt>新手指南</dt>
                    <a href="#">
                        <dd>如何注册</dd>
                    </a>
                    <a href="#">
                        <dd>如何选课</dd>
                    </a>
                    <a href="#">
                        <dd>如何拿到毕业证</dd>
                    </a>
                    <a href="#">
                        <dd>学分是什么</dd>
                    </a>
                    <a href="#">
                        <dd>考试未通过怎么办</dd>
                    </a>

                </dl>
                <dl>
                    <dt>合作伙伴</dt>
                    <a href="#">
                        <dd>合作机构</dd>
                    </a>
                    <a href="#">
                        <dd>合作导师</dd>
                    </a>
                </dl>
            </div>
        </div>
    </div>
</body>

</html>

CSS样式

* {
    margin: 0;
    padding: 0;
}

body {
    background-color: #f3f5f7;
}

li {
    list-style: none;
}

a {
    text-decoration: none;
}

.w {
    width: 1200px;
    margin: auto;
}

.header {
    height: 42px;
    background-color: #f3f5f7;
    margin: 30px auto;
}

.logo {
    float: left;
    height: 42px;
    width: 195px;
}

.nav {
    float: left;
    margin-left: 60px;
}

.nav ul li {
    float: left;
    margin: 0 15px;
    /*这个外边距加给a也可以*/

}

.nav ul li a {
    display: inline-block;
    height: 42px;
    line-height: 42px;
    padding: 0 10px;
    color: #050505;
    font-size: 18px;
}

.nav ul li a:hover {
    color: #00a4ff;
    border-bottom: 2px solid #00a4ff;
}

.search {
    float: left;
    width: 412px;
    height: 42px;
    background-color: skyblue;
    margin-left: 70px;
}

/* input button都属于行内块元素之间默认有缝隙,添加浮动后就没了 */
.search input {
    float: left;
    width: 345px;
    height: 40px;
    border: 1px solid #00a4ff;
    border-right: 0;
    color: #bfbfbf;
    font-size: 14px;
    padding-left: 15px;
}

.search button {
    float: left;
    width: 50px;
    height: 42px;
    background-image: url(image/button.png);
    /* 清除按钮边框 */
    border: 0;
}

.user {
    float: right;
    height: 42px;
    line-height: 42px;
    margin-right: 30px;
    color: #666;
    font: 14px;
}

.banner {
    height: 420px;
    background-color: #1c036c;
}

.banner .w {
    height: 420px;
    background: url(image/banner.png) no-repeat top center;
}

.subnav {
    float: left;
    width: 190px;
    height: 420px;
    background-color: rgba(0, 0, 0, .3);
}

.subnav ul li {
    height: 45px;
    line-height: 45px;
    padding: 0 20px;
}

.subnav ul .one {
    padding-top: 5px;
}

.subnav ul li a {
    font-size: 14px;
    color: #fff;
}

.subnav ul li a span {
    float: right;
}

.subnav ul li a:hover {
    color: #00a4ff;
}

.course {
    float: right;
    width: 230px;
    height: 300px;
    background-color: #fff;
    /* 浮动的盒子没有外边距合并问题 */
    margin-top: 50px;
}

.course h3 {
    height: 47px;
    background-color: #9bceea;
    line-height: 47px;
    text-align: center;
    font-weight: 700;
    color: #fff;
}

.bd {
    padding: 0 20px;
}

.bd ul li {
    height: 29px;
    border-bottom: 1px solid #a5a5a5;
    padding: 17px 0;
}

.bd ul li h4 {
    font-size: 16px;
    color: #414141;
}

.bd ul li p {
    font-size: 12px;
    color: #a5a5a5;
}

.bd a {
    display: block;
    height: 40px;
    line-height: 40px;
    border: 1px solid #00a4ff;
    margin-top: 10px;
    color: #00a4ff;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
}

.bd a:hover {
    color: #fff;
    background-color: #00a4ff;
}

.goods {
    margin-top: 10px;
    height: 60px;
    background-color: #fff;
    box-shadow: 0px 10px 7px -9px rgba(0, 0, 0, .2);
    line-height: 60px;
}

.goods h4 {
    float: left;
    margin-left: 35px;
    color: #004aff;
}

.goods .goods-item li {
    float: left;
}

.goods .goods-item li a {
    font-size: 16px;
    color: #050505;
}

.goods .goods-item li a:hover {
    color: #004aff;
}

.goods .goods-item li span {
    padding: 0 35px;
    color: #bfbfbf;
}

.goods .mod {
    float: right;
    margin-right: 30px;
    font-size: 14px;
    color: #004aff;
}

.box {
    /* height: 600px; */
    margin-top: 30px;
}

.box .box-head {
    height: 45px;
}

.box .box-head h3 {
    float: left;
    font-size: 20px;
    color: #494949;
}

.box .box-head a {
    float: right;
    margin-top: 10px;
    margin-right: 30px;
    font-size: 12px;
    color: #a5a5a6;
}

.box .box-body {
    /* height: 555px; */
    width: 1205px;
}

/* 便于以后在ul中添加更多的盒子,所有不设置父元素的高度,
但是会有li浮动带来的影响,故添加一下代码清除浮动 */
.box .clearfix:after {
    content: "";
    display: block;
    height: 0;
    clear: both;
    visibility: hidden;
}

.box .clearfix {
    *zoom: 1;
}

.box-body ul li {
    float: left;
    margin-right: 15px;
    margin-bottom: 15px;
    width: 229px;
    height: 270px;
    background-color: #fff;
}

/* 也可以把li的父盒子设置的足够宽,这样就不要给每行最后一个盒子清除margin-right了 */
.box-body ul .five {
    margin-right: 0;
}

.box-body ul .ten {
    margin-right: 0;
}

.box-body ul li img {
    width: 100%;
    /* height: 155px; */
}

.box-body ul li h4 {
    font-size: 14px;
    color: #050505;
    margin: 20px 20px 20px 25px;
    font-weight: 400;
}

.box-body ul li .info {
    margin: 0 20px 0 25px;
    font-size: 12px;
    color: #999;
}

.box-body ul li .info span {
    color: #ff7c2d;
}

.box-body ul li:hover {
    box-shadow: 7px 5px 10px -3px rgba(0, 0, 0, .2);
}

.box2 {
    /* height: 600px; */
    margin-top: 30px;
}

.box2 .box2-head {
    height: 40px;
}

.box2 .box2-head h3 {
    float: left;
    font-size: 20px;
    color: #494949;
}

.box2 .box2-head a {
    float: right;
    margin-top: 10px;
    margin-right: 30px;
    font-size: 12px;
    color: #a5a5a6;
}

.box2 .box2-head ul {
    margin-left: 350px;
}

.box2 .box2-head ul li {
    float: left;
    margin-right: 70px;
}

.box2 .box2-head ul li a {
    margin-top: 0;
    font-size: 16px;
}

.box2 .box2-head ul li a:hover {
    color: #004aff;
}

.box2 .box2-body {
    width: 1205px;
    height: 395px;
    /* background-color: pink; */
}

.box2-body .body-left {
    float: left;
    width: 230px;
    height: 395px;
    background-color: #fff;
}

.box2-body .body-right {
    float: right;
    width: 960px;
    height: 395px;
}

.box2-body .body-right .body-right-top {
    width: 960px;
    height: 100px;
    margin-bottom: 25px;
    background-color: #fff;
}

.box2-body .body-right ul li {
    float: right;
    width: 228px;
    height: 270px;
    margin-left: 15px;
    background-color: #fff;
}

.box2-body .body-right ul .last {
    margin-left: 0;
}

.box2-body .body-right ul li img {
    width: 100%;
    /* height: 155px; */
}

.box2-body .body-right ul li h4 {
    font-size: 14px;
    color: #050505;
    margin: 20px 20px 20px 25px;
    font-weight: 400;
}

.box2-body .body-right ul li .info {
    margin: 0 20px 0 25px;
    font-size: 12px;
    color: #999;
}

.box2-body .body-right ul li .info span {
    color: #ff7c2d;
}

.box2-body .body-right ul li:hover {
    box-shadow: 7px 5px 10px -3px rgba(0, 0, 0, .2);
}

.footer {
    height: 208px;
    background-color: #fff;
}

.footer .w {
    margin-top: 40px;
}

.copyright {
    float: left;
}

.copyright img {
    margin-top: 30px;
    margin-left: 20px;
}

.copyright p {
    font-size: 12px;
    color: #666;
    margin-top: 20px;
    margin-left: 20px;
}

/* 因为a是行内元素添加上外边距无效,要转换为块元素 */
.copyright a {
    display: block;
    margin-top: 18px;
    margin-left: 20px;
    height: 33px;
    width: 118px;
    border: 1px solid #00a4ff;
    color: #00a4ff;
    text-align: center;
    line-height: 33px;
}

.copyright a:hover {
    color: #fff;
    background-color: #00a4ff;
}

.link {
    float: right;
}

.link dl {
    float: left;
    margin-top: 30px;
    margin-left: 100px;
}

.link dl dt {
    color: #333;
    margin-bottom: 10px;
}

.link dl dd {
    margin-bottom: 5px;
}

.link dl a {
    font-size: 12px;
    color: #333;
}

.link dl a:hover {
    color: #004aff;
}

效果:
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

发布了7 篇原创文章 · 获赞 2 · 访问量 418
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 数字20 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览