题
当网站获得Creative Commons许可时,我使用 rel-license microformat 。当一个网站按照常规版权许可时,我会有一个无聊的段落元素。
<p id="copyright">© 2008 Example Corporation</p>
那里的id属性仅用于CSS样式目的。我想知道是否有更好的方法来标记更具语义的版权声明。这是Dublin Core元数据的工作吗?如果是这样,我该怎么做呢? (我之前从未使用过Dublin Core。)
有些网站主张在head元素中使用元标记:
<meta name="copyright" content="name of owner">
搜索引擎可能会看到这一点,但不会替换页面本身的用户可见通知。
解决方案
感谢Owen指出我的RDFa方向,我想我现在已经有了解决方案:
<div id="footer" xmlns:dc="http://purl.org/dc/elements/1.1/">
<p id="copyright" property="dc:rights">©
<span property="dc:dateCopyrighted">2008</span>
<span property="dc:publisher">Example Corporation</span>
</p>
</div>
根据具体情况,最好使用dc:creator而不是dc:publisher。来自都柏林核心网站:
如果Creator和Publisher相同,请不要在Publisher区域中重复该名称。如果责任的性质不明确,建议的做法是将Publisher用于组织,将Creator用于个人。如果责任较轻或模棱两可,除了创建之外,请使用Contributor。
我还将为我的head元素添加一个元标记,用于尚不支持RDFa的搜索引擎。
<meta name="copyright" content="© 2008 Example Corporation" />
其他提示
标记它的语义最正确的方法可能是定义列表。
<dl id="copyright">
<dt title="Copyright">©</dt>
<dd>2008 Example Corporation</dd>
</dl>
为什么不使用CC格式,但表示没有授予权限?
在任何情况下,使用CC格式的主要问题是人们无法清楚地识别出他们所适用的网页的哪些元素。
不隶属于 StackOverflow