我正在使用相同的类选择器,但我不明白为什么它的行为不同。
这是我的网站:
在第一种情况下,边距很好;在第二种情况下,不是。
<!-- Side Navigation__________________________________-->
<div class="side_nav_wrapper">
<div class="side_nav_photos" id="side_wrapper_text">photos</div>
<div class="side_nav_about" id="side_wrapper_text">about</div>
<div class="side_nav_writing" id="side_wrapper_text" >writing</div>
<div class="side_nav_contact" id="side_wrapper_text">contact</div>
</div>
<!-- CONTENT____________________________________________-->
<div class="content_wrapper">
<!-- Photo __________________________________________-->
<div class="home_photo">
</div>
<hr class="line">
<!-- About___________________________________________________-->
<div class="home_text">
<p>Emma Carmichael is a writer and editor based in Brooklyn, NY, although she hails from Brattleboro, VT. Emma graduated from Vassar College in 2010 with a degree in Urban Studies; the theme of her thesis about contextualizing female rappers, ETC.
</p>
</div>
<hr class="line">
(另外,我不知道为什么这个类不适用:)
#side_wrapper_text a:link{
font-family: 'Playfair Display', sans-serif;
font-size: 20px;
font-weight: 100;
color:rgba (255,255,255,1);
text-decoration: none;
text-align: center;
letter-spacing:0.2em;
}
<div class="side_nav_wrapper">
<div class="side_nav_photos" id="side_wrapper_text">photos</div>
<div class="side_nav_about" id="side_wrapper_text">about</div>
<div class="side_nav_writing" id="side_wrapper_text" >writing</div>
<div class="side_nav_contact" id="side_wrapper_text">contact</div>
</div>
谢谢你!!