效果跟老师不同.代码检查很多遍了

效果跟老师不同.代码检查很多遍了

http://img1.sycdn.imooc.com/climg//591036050001542219161079.jpg

* {

font-family: Arial;

font-size:  14px;

margin: 0;

padding: 0;

border: none;

}

 a {

text-decoration: none;


}


 ul {

list-style: none;

}


header {

height: 80px;

background: #000;


}


header > .container {

width: 1200px;

margin:auto;

}


header > .container > a {

display: block;

float: left;

margin: 5px 25px;

}


header > .container > nav {

float: right;

}


header > .container > nav > a {

font-size: 24px;

line-height: 73px;

display: block;

float: left;

width: 110px;

height: 73px;

text-align: center;

color: #fff;

}


header>.container>nav >a.Home{background: #433b90;}

header>.container>nav >a.Courseheader{background:#017fcb;}

header>.container>nav >a.Acrual{background: #78b917;}

header>.container>nav >a.Plan{background: #feb800;}

header>.container>nav >a.FAQ{background: #f27c01;}

header>.container>nav >a.Notes{background: #d40112;}


正在回答 回答被采纳积分+1

登陆购买课程后可参与讨论,去登陆

7回答
洋葱宝宝 2017-05-21 16:32:46

header下的div没加".container"

海纳百川_ 2017-05-08 19:01:18

http://img1.sycdn.imooc.com/climg//59104fd600013e8116620185.jpg在课程的右侧有老师讲的案例的源代码,你可以下载下来认真比对一下

提问者 HJunW_ 2017-05-08 18:18:12

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>imooc</title>

<link rel="stylesheet" type="text/css" href="style.css">

</head>

<body>

<header>

<div>

<a href="imooc.html"><img src="images/logo.png"></a>

<nav>

<a href="imooc.html">Home<a>

<a href="#">Course<a>

<a href="#">Acrual<a>

<a href="#">Plan<a>

<a href="#">FAQ<a>

<a href="#">Notes<a>

</nav>

</div>

</header>

<section>

<ul>

<li><img src="images/banner/banner1.jpg"></li>

<li><img src="images/banner/banner2.jpg"></li>

<li><img src="images/banner/banner3.jpg"></li>

</ul>

</section>

<section>

<aside>

<h1>Recent <samp>Course</samp></h1>

<dd>

<dt>Hyper Text Markup Language</dt>

<dd><img src="images/Course/05_05.png" alt=""></dd>

<dd>HTML is the standard markup language used to create web pages and its elements form the building blocks of all websites.</dd>

</dl>

<dt>Cascading Style Sheets</dt>

<dd><img src="images/Course/06_04.png" alt=""></dd>

<dd>Cascading Style Sheets (CSS) is a simple mechanism for adding style (e.g., fonts, colors, spacing) to Web documents.</dd>

2

</dl>

<dt>JavaScript</dt>

<dd><img src="images/Course/09_07.png" alt=""></dd>

<dd>JavaScript is a high-level, dynamic, untyped, and interpreted programming language.</dd>


</dl>

<dt>AngularJS</dt>

<dd><img src="images/Course/02_09.png" alt=""></dd>

<dd>AngularJS is an open-source web application framework mainly maintained by Google and by a community of individuals and...</dd>


</dl>

</aside>

</section>

<article>

<h1>Welcome to <samp>Massive Open Online Course!<samp></h1>

<p>We provide the latest knowledge to help you cope with the changing world!</p>

<img src="images/article.jpg">

<p>We hope that all the students who love the Internet can be more convenient access to learning resources, using the Internet thinking to change our learning.</p>

<p>Focus on IT skills education MOOC, consistent with the development trend of the Internet down to earth's MOOC. We are free, we only teach useful, we concentrate on education.</p>

</article>

<footer>

<div>

<p>Copyright © 2016 imooc.com All Rights Reserved.</p>

<span>

<img src="images/icon/weichat.png">

<img src="images/icon/sina.png">

<img src="images/icon/qq.png">

</span>

<div>

</footer>

</body>

</html>

//+++++++++++++++++++++++++++++CSS++++++++++++++++++++++++++++//


* {

font-family: Arial;

font-size:  14px;

margin: 0;

padding: 0;

border: none;

}

 a {

text-decoration: none;


}


 ul {

list-style: none;

}


header {

height: 80px;

background: #000;


}


header > .container {

width: 1200px;

margin: 0 auto;

}


header > .container > a {

display: block;

float: left;

margin: 5px 25px;

}


header > .container > nav {

float: left;

}


header > .container > nav > a {

font-size: 24px;

line-height: 73px;

display: block;

float: left;

width: 110px;

height: 73px;

text-align: center;

color: #fff;

}


header >.container > nav >a.Home{background: #433b90;}

header >.container > nav >a.Courseheader{background:#017fcb;}

header >.container > nav >a.Acrual{background: #78b917;}

header >.container > nav >a.Plan{background: #feb800;}

header >.container > nav >a.FAQ{background: #f27c01;}

header >.container > nav >a.Notes{background: #d40112;}

header >.container > nav > a:hover,

header >.container > nav > a:active { padding-bottom: 7px; }


提问者 HJunW_ 2017-05-08 18:05:32

* {

font-family: Arial;

font-size:  14px;

margin: 0;

padding: 0;

border: none;

}

 a {

text-decoration: none;


}


 ul {

list-style: none;

}


header {

height: 80px;

background: #000;


}


header > .container {

width: 1200px;

margin: 0 auto;

}


header > .container > a {

display: block;

float: left;

margin: 5px 25px;

}


header > .container > nav {

float: left;

}


header > .container > nav > a {

font-size: 24px;

line-height: 73px;

display: block;

float: left;

width: 110px;

height: 73px;

text-align: center;

color: #fff;

}


header >.container > nav >a.Home{background: #433b90;}

header >.container > nav >a.Courseheader{background:#017fcb;}

header >.container > nav >a.Acrual{background: #78b917;}

header >.container > nav >a.Plan{background: #feb800;}

header >.container > nav >a.FAQ{background: #f27c01;}

header >.container > nav >a.Notes{background: #d40112;}

header >.container > nav > a:hover,

header >.container > nav > a:active { padding-bottom: 7px; }


海纳百川_ 2017-05-08 17:42:35

http://img1.sycdn.imooc.com/climg//59103d5400015afb06190267.jpghtml代码中没有对应的类名呀,你再校对一下代码

  • 提问者 HJunW_ #1
    Html修改好了!但是style.css代码跟老师一样,Css样式效果与老师不同
    2017-05-08 17:58:46
  • 海纳百川_ 回复 提问者 HJunW_ #2
    你放上来呀,我帮你调试一下
    2017-05-08 18:02:54
  • 提问者 HJunW_ 回复 海纳百川_ #3
    * { font-family: Arial; font-size: 14px; margin: 0; padding: 0; border: none; } a { text-decoration: none; } ul { list-style: none; } header { height: 80px; background: #000; } header > .container { width: 1200px; margin: 0 auto; } header > .container > a { display: block; float: left; margin: 5px 25px; } header > .container > nav { float: left; } header > .container > nav > a { font-size: 24px; line-height: 73px; display: block; float: left; width: 110px; height: 73px; text-align: center; color: #fff; } header >.container > nav >a.Home{background: #433b90;} header >.container > nav >a.Courseheader{background:#017fcb;} header >.container > nav >a.Acrual{background: #78b917;} header >.container > nav >a.Plan{background: #feb800;} header >.container > nav >a.FAQ{background: #f27c01;} header >.container > nav >a.Notes{background: #d40112;} header >.container > nav > a:hover, header >.container > nav > a:active { padding-bottom: 7px; }
    2017-05-08 18:04:29
提问者 HJunW_ 2017-05-08 17:21:47

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>imooc</title>

<link rel="stylesheet" type="text/css" href="style.css">

</head>

<body>

<header>

<div>

<a href="imooc.html"><img src="images/logo.png"></a>

<nav>

<a href="imooc.html">Home<a>

<a href="#">Course<a>

<a href="#">Acrual<a>

<a href="#">Plan<a>

<a href="#">FAQ<a>

<a href="#">Notes<a>

</nav>

</div>

<section>

<ul>

<li><img src="images/banner/banner1.jpg"></li>

<li><img src="images/banner/banner2.jpg"></li>

<li><img src="images/banner/banner3.jpg"></li>

</ul>

</section>

<section>

<h1>Recent <samp>Course</samp></h1>

<dd>

<dt>Hyper Text Markup Language</dt>

<dd><img src="images/Course/05_05.png" alt=""></dd>

<dd>HTML is the standard markup language used to create web pages and its elements form the building blocks of all websites.</dd>

</dl>

<dt>Cascading Style Sheets</dt>

<dd><img src="images/Course/06_04.png" alt=""></dd>

<dd>Cascading Style Sheets (CSS) is a simple mechanism for adding style (e.g., fonts, colors, spacing) to Web documents.</dd>


</dl>

<dt>JavaScript</dt>

<dd><img src="images/Course/09_07.png" alt=""></dd>

<dd>JavaScript is a high-level, dynamic, untyped, and interpreted programming language.</dd>


</dl>

<dt>AngularJS</dt>

<dd><img src="images/Course/02_09.png" alt=""></dd>

<dd>AngularJS is an open-source web application framework mainly maintained by Google and by a community of individuals and...</dd>


</dl>

</section>

<article>

<h1>Welcome to <samp>Massive Open Online Course!<samp></h1>

<p>We provide the latest knowledge to help you cope with the changing world!</p>

<img src="images/article.jpg">

<p>We hope that all the students who love the Internet can be more convenient access to learning resources, using the Internet thinking to change our learning.</p>

<p>Focus on IT skills education MOOC, consistent with the development trend of the Internet down to earth's MOOC. We are free, we only teach useful, we concentrate on education.</p>

</article>

<footer>

<div>

<p>Copyright © 2016 imooc.com All Rights Reserved.</p>

<span>

<img src="images/icon/weichat.png">

<img src="images/icon/sina.png">

<img src="images/icon/qq.png">

</span>

<div>

</footer>

</header>

</body>

</html>


海纳百川_ 2017-05-08 17:20:09

这位童鞋,能不能把你的代码完整的粘上来,这样方便我帮你调试。

  • 提问者 HJunW_ #1
    上面是2-1的代码,其他还没学,第一个是css
    2017-05-08 17:23:06
问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
HTML5与CSS3实现动态网页 2018
  • 参与学习       1887    人
  • 提交作业       4643    份
  • 解答问题       5760    个

有HTML和CSS基础,却不知道如何进阶?本路径带你通过系统学习,完成从“会做网页”到“做出好的动态网页”的蜕变,迈出成为前端工程师的第一步。

了解课程
请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师