如何防止CSS正文影响特定的Div?

时间:2015-10-17 20:53:49

标签: html css

我最近开始使用Filegator作为我网站的文件管理器,并且在我将其集成到我的网站设计中的过程中,我添加了我的网站标题。

我的问题是我的标题的几个部分似乎受到Filegator的一些css规则的影响,更具体地说某些边缘/高度没有被尊重。 有问题的标题部分是一个带有以下css的简单div:

#account {
    position: absolute;
    text-align: left;
    left: 0;
    top: 0;
    font-family: "Century Gothic", CenturyGothic, AppleGothic, sans-serif;
    font-size: 15px;
    color: #3F3F3F;
    margin-left: 10px;
    margin-top: 10px;
    padding: 0 10px 0 10px;
}

经过一些研究后,我注意到我来自一个css文件名foundation.css而且,在内部,如果我删除这段特殊代码,我的标题会恢复正常:

body
{
    background: white;
    color: #222222;
    font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1;
    position: relative;
    webkit-font-smoothing: antialiased;
}

对于文件管理器来说,代码行是必不可少的,所以我尝试添加着名的:not(),如下所示:

  body:not(#account)
{
    background: white;
    color: #222222;
    font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1;
    position: relative;
    webkit-font-smoothing: antialiased;
}

但是body:not()没有改变任何东西。

如果我用身体和:not()

之间的空格来写它会变得更糟

有没有人有建议来帮我解决这个问题? 任何帮助都会非常感激

由于

-Apatik

1 个答案:

答案 0 :(得分:0)

您不会覆盖的唯一规则似乎是行高,因此您可以尝试在您的帐户中明确设置或取消设置。

#account{
  ...
 line-height:0; 
}