【发布时间】:2010-09-13 19:31:12
【问题描述】:
作者的编辑:很抱歉对此造成混淆。我将路径更改为另一个文件夹并从旧文件中读取!我的错。感谢大家的帮助。
我的理解是,如果您将特定规则置于 CSS 中的一般规则之下,则特定规则应覆盖一般规则。例如,在这个正在开发中的page,我有以下代码:
body id如下:
<body id="inside" class="blog">
<h3><a href="http://dev.extraspecialpatient.com/blog/entry/test-blog-entry/">Test Blog Entry</a></h3>
<p class="entry-date">published September 13, 2010</p>
<p>
This is a test of the American Broadcasting System to see if my entry shows up properly on the website. Summary information goes here.</p>
<p>Sentence two.</p>
<p>Sentence three.</p>
这是该内容的通用样式:
body#inside #content p {
margin: 0;
padding: 0 0 20px 20px;
color: #000;
font: 14px/22px "Myriad Pro", Arial, sans-serif;
}
我需要修改段落的填充并设置日期信息的样式,因此我在下面放置了以下内容:
body#inside.blog #content p { padding: 0 20px 10px 20px; }
body#inside.blog #content p.entry-date {
font-size: 11px;
color: #4d6b53;
font-style: italic;
margin: -3px 0 0 20px;
padding: 0;
}
如果能帮我解决这个问题,我将不胜感激。
谢谢!
【问题讨论】:
-
我根本没有看到元素检查器中出现您的具体规则。它们在哪里添加?
-
我的错。我将路径更改为另一个目录,它已从旧目录中准备好。很抱歉给您带来麻烦。
-
一切正常。