老师,练习中的字体和粗细分别用的哪些值,为什么总是调整不出来?顺便麻烦老师看一下我的代码是否正确
来源:2-5 编程练习
贾小妞
2019-11-06 21:54:49
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>IMOOC</title>
<style type="text/css">
*{margin: 0;padding: 0;}
.main{position:relative;width: 1250px;height: 550px;margin: 34px auto 0;}
h1{font-size: 30px;font-weight: lighter;color: black;}
h1 span{font-size: 30px; color: darkgrey;margin-left: 10px;}
.main > aside{float:left;width: 480px;height: 550px;}
.main > aside > dl { position: relative; display: block; height: 60px; margin-bottom: 37px; }
.main > aside > dl > dt{position: absolute;padding-left: 85px;font-weight: 700;text-decoration: underline;font-size: 16px;margin-top: 20px;}
.main > aside > dl > dd:first-of-type{position:absolute;margin:15px;padding-top: 10px;}
aside dl dd span{position:absolute;top:18px;left: 19px;font-size: 25px;color: #eaeaea;}
.main > aside > dl > dd:last-of-type{position: absolute;padding-left: 85px;margin-top: 45px;font-weight: 300;line-height: 17px;}
.main > article{float: right;width: 735px;height: 550px; margin-left: 35px;overflow: hidden; }
.main > article > p,
.main > article > h1,
.main > article > img { margin-bottom: 20px;}
.main > article > img { height: 200px;width: 700px;}
.main > article > p{font-weight: 300;}
</style>
</head>
<body>
<!-- 在此完成网页的HTML代码-->
<section class="main">
<aside>
<h1>Recent<span>Course</span></h1>
<dl>
<dt>Hyper Text Markup Language</dt>
<dd><img src="http://climg.mukewang.com/582e61290001787900500051.png"/><span>1</span></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>
<dl>
<dt>Cascading Style Sheets</dt>
<dd><img src="http://climg.mukewang.com/582e61290001787900500051.png"/><span>2</span></dd>
<dd>Cascading Style Sheets (CSS) is a simple mechanism for adding style (e.g., fonts, colors, spacing) to Web documents.</dd>
</dl>
<dl>
<dt>JavaScript</dt>
<dd><img src="http://climg.mukewang.com/582e61290001787900500051.png"/><span>3</span></dd>
<dd>AngularJS is an open-source web application framework mainly maintained by Google and by a community of individuals and.</dd>
</dl>
<dl>
<dt>AngularJS</dt>
<dd><img src="http://climg.mukewang.com/582e61290001787900500051.png"/><span>4</span></dd>
<dd>AngularJS is an open-source web application framework mainly maintained by Google and by a community of individuals and.</dd>
</dl>
</aside>
<article>
<h1>Welcome to <span>Massive Open Online Course!</span></h1>
<p>We provide the latest knowledge to help you cope with the changing world!</p>
<img src="img/582e61180001ede703300130.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>
</section>
</body>
</html>
1回答
好帮手慕码
2019-11-07
同学你好!
效果实现的可以的。关于font-weight的值:
normal 默认值。定义标准的字符。 bold 定义粗体字符。 bolder 定义更粗的字符。 lighter 定义更细的字符。 100,200,300,400,500,600,700,800,900 定义由粗到细的字符。400 等同于 normal,而 700 等同于 bold。 (如果写成数值的话,600才能看出粗体的效果) inherit 规定应该从父元素继承字体的粗细。
如果帮到了你,欢迎采纳,祝学习愉快~
相似问题