這是html檔案:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="https://bbs.csdn.net/topics/mycss.css">
<title>菜鳥教程(runoob.com)</title>
</head>
<body id=newWord>
<h1 id="s2">CSS 實體!</h1>
<p class="s3">這是一個段落。</p>
</body>
</html>
——————————————————————————————
這是css檔案
<style type="text/css">
#newWord
{
background-color:yellow;
}
#s2
{
text-align:center;
color:red;
}
.s3
{
text-align:center;
/*這是另一個注釋*/
color:yellow;
font-family:arial;
}
</style>
請問為什么背景顏色不變呢?加在body上 id不起作用。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/237840.html
標籤:HTML5
上一篇:html
