简体   繁体   English

我的Custom.css无法正常工作

[英]My Custom.css not working

When I inspect a web page I encounter an section element as section#sp-bottom 当我检查网页时,遇到一个section元素为section#sp-bottom

In the styles console, I see 在样式控制台中,我看到了

#sp-bottom (
   margin: 10px 0px 0px 0px;
}

When I change the above 10px to 0px , I can see the page margin of 10px disappear. 当我将上述10px更改为0px ,我可以看到10px的页面边距消失了。

Then in my custom.css of the template, i added 然后在模板的custom.css中,我添加了

#sp-bottom {
   margin: 0px 0px 0px 0px;
}

But after clearing cache the page & browsing history, i still shows the 10px 但是清除缓存页面和浏览历史记录后,我仍然显示10px

Some please teach. 有些请教。

Try increasing more specificity by adding the tag name( section ) to the css selector, 尝试通过将标签name( section )添加到css选择器来提高特异性,

section#sp-bottom {
   margin: 0;
}

你可以试试这个。

section#sp-bottom{ margin:0px;}

You might want to see this question . 您可能希望看到这个问题

I feel that your trying to edit your css through the browser. 我觉得您尝试通过浏览器编辑CSS。 The content is in the memory therefore when you clear the cache it resets. 内容在内存中,因此当您清除缓存时,它将重置。

Try this 尝试这个

#sp-bottom {
   margin:0px !important;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM