好吧,我正在制作一个关于我的计算课上的几个 friend 的笑话网站,我遇到了一个问题,我的 CSS 代码中的包装器不适用于该网页。该包装器适用于网站上的其他页面,但不适用于此页面,以下是 HTML 代码:
<html>
<head>
<link href="main.css" rel="stylesheet" type="text/css>
<title>Ways that George is physically better than Adam</title>
</head>
<body>
<div class=" wrapper ">
<h1> There are many ways that George is physically better than Adam </h1>
<div class="article ">
<ul>
<li>George isn't as fat as Adam.</li>
<li>George has better hair than Adam.</li>
<li>George has a manly assortment of stubble.</li>
<li>George is just more attractive than Adam.</li>
</ul>
<div class="littlearticle ">
<p> <a href="George is better than adam.html "> Click here to return to the homepage. </a> </p>
</div>
</div>
</div>
</html>
这是我的 CSS 代码
body {
text-align: Left;
}
.wrapper {
width:40em;
text-align; left;
margin-left: 150px;
margin-right: 150px;
padding: 8px;
}
h1 {
color:red;
background-color;white;
font-family:tahoma;
border-top:red 2px double;
border-bottom: red 2px dashed;
padding: 8px;
}
.article {
color:blue;
font-family:consolas;
font-size:medium;
background-color:yellow;
padding;
8px;
}
.littlearticle {
color:black;
font-family:consolas;
font-size:medium;
background-color:red;
padding: 8px;
}
最佳答案
四个小错误:
1
<link href="main.css" rel="stylesheet" type="text/css>
应该是:
<link href="main.css" rel="stylesheet" type="text/css">
2
缺少结束正文标记:</body>
3
根据.article
你有padding;8px;
,应该是padding: 8px;
4
根据.wrapper
你有text-align;left;
,应该是text-align: left;
关于html - 为什么我的 CSS 包装器不适用于我的 HTML 代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31179814/