以下の例では、以下から収集されます。
http://6.470.scripts.mit.edu/css_exercises/exercise5.html
.wrapper1 {
width: 60%;
margin: 0px auto 0px auto;
border: 1px solid;
text-align: center;
background: #eeeeee;
}
.wrapper2 {
clear: left;
}
.p1 {
font-size: 70px;
}
.p2 {
font-size: 50px;
}
HTML
<div class="wrapper1">
<div class="wrapper2">
<p class="p1">MIT 6.470</p>
<p class="p2">Learn Web Programming this IAP</p2>
<a href="">Comprehensive Curriculum</a>
<a href="">Insightful Guest Lectures</a>
<a href="">Interaction with Sponsors</a>
<a href="">$30,000+ in Total Prizes</a>
</div>
Copyright © 2012 MIT 6.470
</div>
このスタイルでは、後のリンクp.p2
が に隣接して配置されますp.p2
が、これp
はブロック要素であるため、隣接する他の要素を許可しないでください。次に、 はリンクの祖先ではありませんがp.p2
、リンクのサイズは のサイズと同じです。p.p2
これはどのように可能ですか?