编辑 1 行文本后 CSS 格式不一致

问题描述 投票:0回答:1

我对我正在构建的网站上的

index.html
文件进行了 1 处更改。在此更改之后,网站的 CSS 格式发生了变化。虽然恢复更改并在网站主页上显示过时的信息可能会解决该问题,但我不明白为什么更改
<p>
标签内的内容会弄乱 CSS 格式,因为没有更改标签或其他格式规则.

我做错了什么?

要参考代码/查看我的存储库,可以在此处找到

此外,作为 TL;DR,这里是我的 CSS 文件的内容。

css/global.css

/*Body parameters*/
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background-color: #D9D9D9;
    justify-content: center;
    margin: auto;
    width: auto;
    clear: both;
}

/* Site Version */
.siteVersion {
    font-family: 'Courier New', Courier, monospace;
    font-style: italic;
}

/* Content formatting */
.content {
    position: flex;
    padding: 10px;
    align-content: center;
    margin: auto;
    max-width: 80%;
    background-color: #E6E6E6;
    padding: 20px;
    overflow-y: auto;
}

.grid-container {
    display: grid;
    grid-gap: 5px;
    max-width: auto;
    margin: auto;
    background-color: #E6E6E6;
    align-content: center;
    height: 100%;
    clear: both;
}

.profilePicture {
    float: left;
    margin: 10px;
    height: 165px;
    width: 200px;
}

/* Paragraph */
.paragraph {
    font-family: Arial, Helvetica, sans-serif;
    max-width: 100%;
    margin: auto;
    word-wrap: break-word;
    white-space: pre-line;
}

/* Hyperlinks */
.email {
    font-family: monospace;
    text-decoration: none;
}

.hyperlink {
    text-decoration: none;
}

我已执行以下操作来尝试解决该问题:

  • 删除了在我的文件末尾发现的一些不属于的奇怪内容
  • 与使用
    css/global.css
    文件的其他页面相比,没有发现样式或格式问题

如果有人擅长 CSS,我将不胜感激评论和任何建议。

html css css-selectors
1个回答
0
投票

我还不太擅长CSS,我仍在学习,但我想问一下你是否试图针对

元素或类属性“paragraph”?

© www.soinside.com 2019 - 2024. All rights reserved.