实战:一个在线教育课程网页

阅读量: 169 编辑

Html+Css实战:一个在线教育课程网页

通过这个网页的编程学习,能够掌握基本的 Css 和 Html 的知识点的系统应用,有利于快速学会前端编程技能

一、效果预览

二、代码实战

代码的详细解读,可以参考视频教程

使用方法:创建两个文件 course-04.csscourse-04.html 放在同一个目录中,然后用浏览器打开 course-04.html 即可

文件:course-04.css

body{
    padding: 0px;
    margin: 0px;
}
a{
    color: #2b2b2b;
    text-decoration: none;
    font-weight: bold;
}
a:hover{
    color: dodgerblue;
}

.head-block{
    background-color: #eeeeee;
    height: 60px;
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: center;
}
.head{
    width: 1240px;
    height: 60px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}
.logo{
    width: 48px;
    height: 48px;
    margin-top: -10px;
}
.nav-ul{
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
}
.nav-ul li{
    list-style: none;
    margin-right: 30px;
}
.font14{
    font-size: 14px;
}
.container-block{
    width: 100%;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.container{
    width: 1240px;
    min-height: 500px;
    padding-bottom: 100px;
}
.classify-nav{
    width: 100%;
    border-bottom: 1px solid #ccc;
}
.classify-nav ul li{
    margin: 10px 50px 10px 0px;
}
.classify-a{
    font-weight: normal;
    color: #2b2b2b;
}
.active{
    background-color: #777777;
    color: #fff;
    padding: 5px;
    border-radius: 5px;
}
.active:hover{
    color: #fff;
}
.course-block{
    margin-top: 20px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
}
.course-card{
    width: 220px;
    box-shadow: 0 4px 8px 0 rgba(7,17,27,.1);
    transition: .3s all linear;
    padding-bottom: 20px;
    border-radius: 6px;
    margin: 13px;
}
.course-classify{
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    height: 30px;
    line-height: 30px;
    padding: 5px 10px;
    color: #fff;
}
.bg-green{
    background-color: forestgreen;
}
.bg-red{
    background-color: rosybrown;
}
.bg-pink{
    background-color: #FFC0CB;
}
.bg-yellow{
    background-color: #FFD700;
}
.bg-gray{
    background-color: #8C8C8C;
}
.bg-blue{
    background-color: #63B8FF;
}
.course-name{
    padding: 5px 10px;
    margin-top: 10px;
}
.course-desc{
    padding: 5px 10px;
    margin-top: 10px;
    color: #a1a1a1;
}
.course-info{
    padding: 5px 10px;
    margin-top: 10px;
    color: #a1a1a1;
}


.foot-block{
    background-color: #a1a1a1;
    height: 100px;
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: center;
}
.friend-link{
    width: 1240px;
    height: 100px;
    line-height: 100px;
}
.friend-link a{
    color: #fff;
    text-decoration: underline;
    font-weight: normal;
}



文件:course-04.html

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>在线教育学习平台</title>
        <link href="course-04.css" type="text/css" rel="stylesheet">
    </head>
    <body>
        <div class="head-block">
            <div class="head">
                <ul class="nav-ul">
                    <li>
                        <img class="logo" src="logo.png">
                    </li>
                    <li><a href="">首页</a></li>
                    <li><a href="">课程</a></li>
                    <li><a href="">我的</a></li>
                    <li><a href="">运营CMS</a></li>
                </ul>

                <ul class="nav-ul">
                    <li><a class="font14" href="">登录</a></li>
                    <li><a class="font14" href="">注册</a></li>
                    <li><a class="font14" href="">头像</a></li>
                </ul>
            </div>

        </div>
        <div class="container-block">
            <div class="container">
                <div class="classify-nav">
                    <ul class="nav-ul">
                        <li><a class="classify-a active" href="">全部方向</a></li>
                        <li><a class="classify-a" href="">前端开发</a></li>
                        <li><a class="classify-a" href="">后端开发</a></li>
                        <li><a class="classify-a" href="">移动开发</a></li>
                        <li><a class="classify-a" href="">数据库</a></li>
                        <li><a class="classify-a" href="">云计算&大数据</a></li>
                        <li><a class="classify-a" href="">运维&测试</a></li>
                        <li><a class="classify-a" href="">UI设计</a></li>
                    </ul>
                </div>
                <div class="classify-nav">
                    <ul class="nav-ul">
                        <li><a class="classify-a active" href="">全部分类</a></li>
                        <li><a class="classify-a" href="">Java</a></li>
                        <li><a class="classify-a" href="">HTML/CSS</a></li>
                        <li><a class="classify-a" href="">JavaScript</a></li>
                        <li><a class="classify-a" href="">Jquery</a></li>
                        <li><a class="classify-a" href="">CSS</a></li>
                        <li><a class="classify-a" href="">Python</a></li>
                        <li><a class="classify-a" href="">Django</a></li>
                        <li><a class="classify-a" href="">Android</a></li>
                        <li><a class="classify-a" href="">IOS</a></li>
                        <li><a class="classify-a" href="">WebApp</a></li>
                        <li><a class="classify-a" href="">MySql</a></li>
                        <li><a class="classify-a" href="">MongoDB</a></li>
                        <li><a class="classify-a" href="">Oracle</a></li>
                        <li><a class="classify-a" href="">大数据</a></li>
                    </ul>
                </div>

                <div class="course-block">
                    <div class="course-card ">
                        <div class="course-classify bg-green">Java全栈</div>
                        <div class="course-name">零基础入门JavaWeb全栈编程技术</div>
                        <div class="course-desc">Java开发必备的编程技能,包括前端、后端、数据库、框架等知识</div>
                        <div class="course-info">初级 · 178人在学</div>
                    </div>

                    <div class="course-card ">
                        <div class="course-classify bg-red">Java全栈</div>
                        <div class="course-name">零基础入门JavaWeb全栈编程技术</div>
                        <div class="course-desc">Java开发必备的编程技能,包括前端、后端、数据库、框架等知识</div>
                        <div class="course-info">初级 · 178人在学</div>
                    </div>

                    <div class="course-card">
                        <div class="course-classify bg-yellow">Java全栈</div>
                        <div class="course-name">零基础入门JavaWeb全栈编程技术</div>
                        <div class="course-desc">Java开发必备的编程技能,包括前端、后端、数据库、框架等知识</div>
                        <div class="course-info">初级 · 178人在学</div>
                    </div>

                    <div class="course-card">
                        <div class="course-classify bg-pink">Java全栈</div>
                        <div class="course-name">零基础入门JavaWeb全栈编程技术</div>
                        <div class="course-desc">Java开发必备的编程技能,包括前端、后端、数据库、框架等知识</div>
                        <div class="course-info">初级 · 178人在学</div>
                    </div>

                    <div class="course-card">
                        <div class="course-classify bg-red" >Java全栈</div>
                        <div class="course-name">零基础入门JavaWeb全栈编程技术</div>
                        <div class="course-desc">Java开发必备的编程技能,包括前端、后端、数据库、框架等知识</div>
                        <div class="course-info">初级 · 178人在学</div>
                    </div>

                    <div class="course-card">
                        <div class="course-classify bg-green">Java全栈</div>
                        <div class="course-name">零基础入门JavaWeb全栈编程技术</div>
                        <div class="course-desc">Java开发必备的编程技能,包括前端、后端、数据库、框架等知识</div>
                        <div class="course-info">初级 · 178人在学</div>
                    </div>

                    <div class="course-card">
                        <div class="course-classify bg-red">Java全栈</div>
                        <div class="course-name">零基础入门JavaWeb全栈编程技术</div>
                        <div class="course-desc">Java开发必备的编程技能,包括前端、后端、数据库、框架等知识</div>
                        <div class="course-info">初级 · 178人在学</div>
                    </div>

                    <div class="course-card">
                        <div class="course-classify bg-yellow">Java全栈</div>
                        <div class="course-name">零基础入门JavaWeb全栈编程技术</div>
                        <div class="course-desc">Java开发必备的编程技能,包括前端、后端、数据库、框架等知识</div>
                        <div class="course-info">初级 · 178人在学</div>
                    </div>

                    <div class="course-card">
                        <div class="course-classify bg-green">Java全栈</div>
                        <div class="course-name">零基础入门JavaWeb全栈编程技术</div>
                        <div class="course-desc">Java开发必备的编程技能,包括前端、后端、数据库、框架等知识</div>
                        <div class="course-info">初级 · 178人在学</div>
                    </div>

                    <div class="course-card">
                        <div class="course-classify bg-pink">Java全栈</div>
                        <div class="course-name">零基础入门JavaWeb全栈编程技术</div>
                        <div class="course-desc">Java开发必备的编程技能,包括前端、后端、数据库、框架等知识</div>
                        <div class="course-info">初级 · 178人在学</div>
                    </div>

                </div>
            </div>
        </div>

        <div class="foot-block">
            <div class="friend-link">
                <ul class="nav-ul">
                    <li><a class="font14" href="">企业合作</a></li>
                    <li><a class="font14" href="">联系我们</a></li>
                    <li><a class="font14" href="">常见问题</a></li>
                    <li><a class="font14" href="">意见反馈</a></li>
                    <li><a class="font14" href="">友情链接</a></li>
                </ul>
            </div>
        </div>

    </body>
</html>