html - 为什么我的 CSS 包装器不适用于我的 HTML 代码

标签 html css

好吧,我正在制作一个关于我的计算课上的几个 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/

相关文章:

html - Flexbox 表格标题左对齐与滚动条断开

css - 如何将按钮对齐到 Bootstrap 中行/列的底部?

javascript - 如何控制轮播中视频的暂停/播放?

html - 使导航菜单跨度浏览器的长度

html - django 在 json 中转义 html

html - 如何使用 flexbox 水平放置 3 个按钮?

html - 背景颜色不覆盖 div 的全高

javascript - 如何将 "active"类添加到幻灯片中的可见幻灯片?

html - transitionX 将文本移离屏幕

html - 如何更改导航栏链接悬停和事件状态