.cssファイル:CSSが機能していませんか?
#1test {
color:red;
text-align:center;
}
#1test {
color:red;
text-align:center;
}
の.htmlファイル:
<html>
<p id="1test">hey</p><br/>
<p id="2test">idk</p>
</html>
私はそれで間違っているものを得ることはありません:/
.cssファイル:CSSが機能していませんか?
#1test {
color:red;
text-align:center;
}
#1test {
color:red;
text-align:center;
}
の.htmlファイル:
<html>
<p id="1test">hey</p><br/>
<p id="2test">idk</p>
</html>
私はそれで間違っているものを得ることはありません:/
1)あなたは含めていません。 CSSファイル。
2)ID名は数字で始めることはできません。
しかし、あなたは数字をエスケープすることができます - https://jsfiddle.net/chipChocolate/wzueddej/ –
@ chipChocolate.pyしかしそれはもはや数字で始まらない。しかし、よく知っている – 4castle
利用IDに適切な名前をして HTMLファイルにCSSを含める
<html>
<head>
<link rel="stylesheet" type="text/css" href="css.css">
</head>
<p id="test1">hey</p><br/>
<p id="test2">idk</p>
</html>
CSSファイル
#test1 {
color:red;
text-align:center;
}
#test2 {
color:red;
text-align:center;
}
ここでしか英語で質問を投稿してください。 – 4castle