工作,我不知道爲什麼我的a:first-child
不工作。這裏是我的html:首先,孩子是不是在我的代碼
<!DOCTYPE html>
<link href='http://fonts.googleapis.com/css?family=Geo' rel='stylesheet'>
<title>Mira's place</title>
<header>
<a href="index.html">Mira's place</a><br>
<h2>“<span id="quote">If nothing, then this.</span>”</h2>
<ul>
<li><a href="#">Home</a>
<li><a href="#">Games</a>
<li><a href="#">Pixel Art</a>
<li><a href="#">Contact</a>
</ul>
</header>
<section>
<h2>This is test H2</h2>
<p>This is lorem ipsum shitsum, blah <a href="#">Test</a> blah baldflksafdjsl adslkf ajfdlks ajfldsa jflksda lfhsdalf jdsalfh sdlfdshfdsk fjsdl ajfl
</section>
<footer>
<p>(C) MiraCZ 2013 - You can copy anything here!
</footer>
,這是我的CSS
html {
background-color: #002240;
font-family: "Geo", sans-serif;
margin: 0;
}
header {
background-color: #001629;
margin: 0 -10px 0 -10px;
}
a:first-child {
color: #FF628C;
font-size: 36px;
}
header h2 {
color: #80FFBB;
}
li {
display: inline-block;
font-size: 18px;
}
p {
color: white;
}
我只是想有第一a
是36px大小。任何人都可以幫助它爲什麼會影響其他a
?這裏是我的jsfiddle http://jsfiddle.net/dsT4Z/
這是我看到的。我添加紅色箭頭以顯示其a
的I不想是大小等
是什麼讓你的工作是不是'第n-的-type'但孩子選擇'>'。見http://jsfiddle.net/fSV4Z/1/ –
@RichardJPLeGuen我知道 – henryaaron