Adding Microdata for background images on simple HTML site
我正在尝试使用架构增强我们的旧html网站(网络商店),并且在入门时遇到了一些困难。我想开始将Schema添加到1,500多个单独的html产品页面,因此必须正确地开始使用。
到目前为止,最大的问题是如何添加产品图片代码,因为我们的网站布局是以表格为基础的,表格中插入了主要产品图片作为背景元素。到目前为止,我发现的大多数研究示例都显示了不同的实现方式,这可能吗?
这是一个代码示例:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | <TR> <TD COLSPAN=2><IMG SRC="images/spacer.gif" WIDTH=122 HEIGHT=10 ALT=""></TD> </TR> <TR> <TD COLSPAN=2><IMG SRC="images/spacer.gif" WIDTH=122 HEIGHT=18 ALT=""></TD> </TR> </TABLE> </td> <td valign="top"> <table width="599" border="0" cellpadding="0" cellspacing="0" background="images/LOTR/BKG_Hobbit-Sting-UC2892.jpg" style="background-repeat: no-repeat;"> <tr> <td width="259" valign="top"><span class="style2"><IMG SRC="images/spacer.gif" alt="" WIDTH=259 HEIGHT=150 border="0"></span> <table width="238" border="0" align="right" cellpadding="0" cellspacing="0"> <tr> <td colspan="2"><span class="style109 style31">The HOBBIT BILBO'S STING SWORD</span><span class="style117"> <span class="style33">UC2892 United Cutlery</span></span></td> </tr> |
通过此代码,我想通过Schema.org突出显示
我首先尝试将信息添加到
1 | ; <meta itemprop="image" content="images/LOTR/BKG_Hobbit-Sting-UC2892.jpg"></meta> |
此外,在Bing Markup测试器中进行测试还会得到以下结果:
We are not seeing any markup on this page. Please ensure the markup has been implemented correctly.
不是可以通过
此外,图像链接是否应为完整的URL
由于您的
您可以在
因此在
1 | <link itemprop="image" href="images/LOTR/BKG_Hobbit-Sting-UC2892.jpg" /> |
如果值是URL,则必须使用
(还请注意,
也就是说,如果您对现有内容进行标记而不复制,则Microdata的效果最佳。如果必须复制它,那么使用JSON-LD代替Microdata可能会更好。