• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

CSS3的应用-“优课教育”网站首页弄一个

武飞扬头像
咸蛋_dd
帮助1

放效果图总是违禁,这次就不放了。

可以自己运行一下代码试试看看效果。

效果和书上是一样的。

目录

1.站点信息:

2.HTML代码(已排雷)

3.css代码


1.站点信息:

学新通

 2.HTML代码(已排雷)

  1.  
    <!DOCTYPE html>
  2.  
    <html lang="en">
  3.  
    <head>
  4.  
    <meta charset="UTF-8">
  5.  
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6.  
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7.  
    <title>游客教育网站</title>
  8.  
    <link href="css/style.css" type="text/css" rel="stylesheet"/>
  9.  
    </head>
  10.  
    <body>
  11.  
    <div id="header">
  12.  
    <ul class="nav">
  13.  
    <li class="loge"><img src="images/logo.png"/></li>
  14.  
    <li><a href="#">首页</a></li>
  15.  
    <li><a href="#">学校介绍</a></li>
  16.  
    <li><a href="#">课程介绍</a></li>
  17.  
    <li><a href="#">师资力量</a></li>
  18.  
    <li><a href="#">招生问答</a></li>
  19.  
    <li><a href="#">教学活动</a></li>
  20.  
    </ul>
  21.  
    </div>
  22.  
    <div id="content">
  23.  
    <div class="banner"><img src="images/banner.jpg"/></div>
  24.  
    <div class="style_bg">
  25.  
    <div class="style">
  26.  
    <dl>
  27.  
    <dt class="left1"></dt><dd class="left2"><a href="#">大学专区</a></dd>
  28.  
    <dt class="left3"></dt><dd class="left4"><a href="#">求职专区</a></dd>
  29.  
    </dl>
  30.  
    <dl>
  31.  
    <dt class="center1"></dt><dd class="center2"><a href="#">高中专区</a></dd>
  32.  
    <dt class="center3"></dt><dd class="center4"><a href="#">考证专区</a></dd>
  33.  
    </dl>
  34.  
    <dl class="third">
  35.  
    <dt class="right1"></dt><dd class="right2"><a href="#">线上精品课专区</a></dd>
  36.  
    </dl>
  37.  
    </div>
  38.  
    </div>
  39.  
    <h2>热门课程 / Popular courses</h2>
  40.  
    <div class="current">
  41.  
    <dl>
  42.  
    <dt class="match_1"></dt>
  43.  
    <dd class="current01">软件工程师课程</dd>
  44.  
    <dd class="current02"><a class="three" href="#">高级IT人才的捷径</a></dd>
  45.  
    </dl>
  46.  
    <dl>
  47.  
    <dt class="match_2"></dt>
  48.  
    <dd class="current01">Java课程</dd>
  49.  
    <dd class="current02"><a class="three" href="#">工程师必修课</a></dd>
  50.  
    </dl>
  51.  
    <dl>
  52.  
    <dt class="match_3"></dt>
  53.  
    <dd class="current01">Python课程</dd>
  54.  
    <dd class="current02"><a class="three" href="#">热门行业新趋势</a></dd>
  55.  
    </dl>
  56.  
    <dl>
  57.  
    <dt class="match_4"></dt>
  58.  
    <dd class="current01">UI设计课程</dd>
  59.  
    <dd class="current02"><a class="three" href="#">设计师必修课程</a></dd>
  60.  
    </dl>
  61.  
    </div>
  62.  
    </div>
  63.  
    <div id="footer">
  64.  
    <p>Copyright © 2022-2030 Edu.com,All rights reserved.</p>
  65.  
    <p>2020-2030,版权所有 优客网 00CP备 222222222</p>
  66.  
    </div>
  67.  
    </body>
  68.  
    </html>
学新通

3.css代码

  1.  
    *{margin:0;padding:0;list-style:none;}/*重置浏览器的默认样式*/
  2.  
    body{/*全局控制*/
  3.  
    background:#fff9ed;
  4.  
    font-family:"微软雅黑";
  5.  
    font-size:14px;
  6.  
    }
  7.  
    a:link,a:visited{text-decoration:none;color:#fff;font-size:16px;}
  8.  
    #header{
  9.  
    width:100%;
  10.  
    height:128px;
  11.  
    background:url(../images/head_bg.jpg) repeat-x;
  12.  
    border-bottom:3px solic #d5d5d5;
  13.  
    }
  14.  
    .nav{
  15.  
    width:980px;
  16.  
    margin:0 auto;
  17.  
    }
  18.  
    li{float:left;}
  19.  
    li a{
  20.  
    display:inline-block;
  21.  
    height:91px;
  22.  
    width:119px;
  23.  
    text-align:center;
  24.  
    line-height:70px;
  25.  
    }
  26.  
    li a:hover{background:url(../images/xuanfu.png) center center;}
  27.  
    #content{
  28.  
    width:980px;
  29.  
    margin:0 auto;
  30.  
    }
  31.  
    .style_bg{
  32.  
    width:908px;
  33.  
    height:330px;
  34.  
    background:#6dbf2d;
  35.  
    padding:10px 36px 5px;
  36.  
    }
  37.  
    .style{
  38.  
    width:892px;
  39.  
    height:314px;
  40.  
    background:#fff;
  41.  
    padding:8px 10px 8px 6px;
  42.  
    }
  43.  
    .style dl{
  44.  
    width:279px;
  45.  
    height:313px;
  46.  
    float:left;
  47.  
    margin-left:4px;
  48.  
    }
  49.  
    .style .third{width:322px;}
  50.  
    .style dt,.style dd{float:left;}
  51.  
    .style .left1,.style .left3,.style .center1,.style .center3{width:162px;}
  52.  
    .style .left2,.style .left4,.style .center2,.style .center4,.style .right2{width:117px;}
  53.  
    .style .left1,.style .left2,.style .center1,.style .center2{margin-bottom:8px;}
  54.  
    .style .left1{
  55.  
    height:169px;
  56.  
    background:url(../images/pic01.jpg) no-repeat;
  57.  
    }
  58.  
    .style .left2{
  59.  
    height:160px;
  60.  
    line-height:169px;
  61.  
    }
  62.  
    .style .left3{
  63.  
    height:137px;
  64.  
    background:url(../images/pic02.jpg) no-repeat;
  65.  
    }
  66.  
    .style .left4{
  67.  
    height:137px;
  68.  
    line-height:137px;
  69.  
    }
  70.  
    .style .center1{
  71.  
    height:117px;
  72.  
    background:url(../images/pic03.jpg) no-repeat;
  73.  
    }
  74.  
    .style .center2{
  75.  
    height:117px;
  76.  
    line-height:117px;
  77.  
    }
  78.  
    .style .center3{
  79.  
    height:188px;
  80.  
    background:url(../images/pic04.jpg) no-repeat;
  81.  
    }
  82.  
    .style .center4{
  83.  
    height:188px;
  84.  
    line-height:188px;
  85.  
    }
  86.  
    .style .right1{
  87.  
    width:205px;
  88.  
    height:314px;
  89.  
    background:url(../images/pic05.jpg) no-repeat;
  90.  
    }
  91.  
    .style .right2{
  92.  
    height:314px;
  93.  
    line-height:314px;
  94.  
    }
  95.  
    .style a{
  96.  
    display:block;
  97.  
    background:#f2f2f2;
  98.  
    text-align:center;
  99.  
    color:#333;
  100.  
    }
  101.  
    .style a:hover{background:#6dbf2d;}
  102.  
    h2{
  103.  
    width:259px;
  104.  
    height:45px;
  105.  
    background:#6bdf2d;
  106.  
    font-size:20px;
  107.  
    font-weight:100;
  108.  
    line-height:45px;
  109.  
    text-align:center;
  110.  
    color:#fff;
  111.  
    margin-top:80px;
  112.  
    }
  113.  
    .current{
  114.  
    width:958px;
  115.  
    height:342px;
  116.  
    background:#fff;
  117.  
    border:1px solic #dcd2ba;
  118.  
    padding:13px 0 0 20px;
  119.  
    }
  120.  
    .current dl{
  121.  
    width:229px;
  122.  
    height:330px;
  123.  
    border:1px solic #dcd2ba;
  124.  
    float:left;
  125.  
    margin-right:5px;
  126.  
    }
  127.  
    .current dt{
  128.  
    width:229px;
  129.  
    height:212px;
  130.  
    border-bottom:1px solic #dcd2bA;
  131.  
    }
  132.  
    .current01{
  133.  
    width:229px;
  134.  
    height:66px;
  135.  
    background:#fff;
  136.  
    line-height:66px;
  137.  
    color:#7a7a7a;
  138.  
    font-size:22px;
  139.  
    text-align:center;
  140.  
    }
  141.  
    .current02{
  142.  
    width:140px;
  143.  
    height:38px;
  144.  
    background:#6dbf2b url(../images/gouwu.jpg) left center no-repeat;
  145.  
    margin:0 14px;
  146.  
    line-height:38px;
  147.  
    padding-left:60px;
  148.  
    color:#fff;
  149.  
    }
  150.  
    .match_1{background:url(../images/match01.jpg) center center no-repeat;}
  151.  
    .match_2{background:url(../images/match02.jpg) center center no-repeat;}
  152.  
    .match_3{background:url(../images/match03.jpg) center center no-repeat;}
  153.  
    .match_4{background:url(../images/match04.jpg) center center no-repeat;}
  154.  
    .current a{display:inline-block;width:180px;height:38px;}
  155.  
    #footer{
  156.  
    width:100%;
  157.  
    height:103px;
  158.  
    background:#020202;
  159.  
    color:#fff;
  160.  
    line-height:26px;
  161.  
    text-align:center;
  162.  
    padding-top:50px;
  163.  
    margin-top:65px;
  164.  
    }
学新通

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /boutique/detail/tanhhaebfc
系列文章
更多 icon
同类精品
更多 icon
继续加载