[英]How can i prevent a CSS body from affecting a specific Div?
I recently started using Filegator as a file manager for my website, and in my quest of integrating it in my website's design i added my website's header to it. 我最近开始将Filegator用作网站的文件管理器,并且为了将其集成到网站的设计中,我在其中添加了网站的标头。
My problem is that a couple parts of my header seem to be affected by some css rules from Filegator, more specifically some kind of margin/height not being respected. 我的问题是我的标头的几个部分似乎受到Filegator的某些CSS规则的影响,更具体地说,某些边距/高度没有得到遵守。 The part of the header in question is a simple div with the following 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;
}
After some research i noticed that i comes from a css file name foundation.css and that, inside, if i delete this particular line of code my header goes back to normal : 经过一番研究后,我发现我来自一个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;
}
Thing is that line of code is essential for the file manager, so i tried adding the famous :not() like this : 问题是代码行对于文件管理器至关重要,因此我尝试添加著名的: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;
}
But body:not()
did not change anything. 但是body:not()
并没有改变任何东西。
It gets even worse if i write it with a space between body and :not()
如果我用body和:not()
之间的空格写它,那就更糟了。
Does anyone have suggestions to help me with this ? 有人有建议可以帮助我吗? Any help would be really appreciated 任何帮助将非常感激
Thanks 谢谢
-Apatik -阿帕蒂克
the only rule that you don't override seems line-height, so you could try to explictly set or unset this in you 'account. 唯一不能忽略的规则是行高,因此您可以尝试在帐户中明确设置或取消设置。
#account{
...
line-height:0;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.