aside和article高度不一样
1 2 3 4 5 6 7 8 9 10 11 12 13 | /*main*/ .main { position: relative; width: 1200px; height: 473px; margin: 34px auto 0; } .main h1 { font-size: 30px; font-weight: lighter; margin-bottom: 23px; } .main h1 > samp { font-size: 30px; color: #7c7c7c; } .main > aside { float: left; width: 450px; } .main > aside > dl { position: relative; display: block; height: 74px; margin-bottom: 17px; } .main > aside > dl > dt { position: absolute; top: -1px; left: 92px; font-size: 16px; font-weight: bold; line-height: 16px; text-decoration: underline; } .main > aside > dl > dd:first-of-type { position: absolute; left: 0; font-size: 30px; font-weight: block; line-height: 50px; display: block; color: white; width: 50px; height: 50px; background-image: url(http://img1.sycdn.imooc.com/climg//582e61290001787900500051.png);} .main > aside > dl > dd:last-of-type { position: absolute; top: 20px; left: 90px; } .main > article { float: right; width: 720px; overflow: hidden; } .main > article > p, .main > article > img {margin-bottom: 20px; width: 720px;} |
<articl>
<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="http://img1.sycdn.imooc.com/climg//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 to change our learing.</p>
<p>Foucus in 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>
</articl>
正在回答
首先标签有问题:articl和ariticla都不对,正确的是article
其次要统一两边高度,对于统一aside和ariticle的高度来说等同于基本没有改变;
我们可以从内容入手,如:改动文字和图片大小:
.main > article > p {margin-bottom: 20px;} .main > article > img {margin-bottom: 20px; width: 720px;height: 200px;
这个是内容没有撑开,内容多了就好了。控制图片大小给img定义宽高样式就好了
那个地方高度不一样?
- 参与学习 1887 人
- 提交作业 4643 份
- 解答问题 5760 个
有HTML和CSS基础,却不知道如何进阶?本路径带你通过系统学习,完成从“会做网页”到“做出好的动态网页”的蜕变,迈出成为前端工程师的第一步。
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星