I'm adding the schema.org Microdata to my website.
My HTML code is like this:
<div itemscope itemtype="http://schema.org/Organization">
<span class="title">Name of the organization</span>
<a href="http://www.ABCCompany.com/">ABC Company</a>
</div>
Since the itemprop
"url" and "name" of the Organization are all in the anchor tag. How can I indicate the both "url" and "name" itemprop
on the same tag? Must I add extra span
tag for this purpose?
I have tried searching some coding examples on this but cannot find any example to show the use of multiple itemprop
on the same tag.
At the end, I want to have Microdata like this:
url="http://www.ABCCompany.com", name="ABC Company"
An anchor name is the value of either the name or id attribute when used in the context of anchors. Anchor names must observe the following rules: Uniqueness: Anchor names must be unique within a document. Anchor names that differ only in case may not appear in the same document.
The <a> HTML element (or anchor element), with its href attribute, creates a hyperlink to web pages, files, email addresses, locations in the same page, or anything else a URL can address.
The <a> tag (anchor tag) in HTML is used to create a hyperlink on the webpage. This hyperlink is used to link the webpage to other web pages or some section of the same web page. It's either used to provide an absolute reference or a relative reference as its “href” value.
You have to do it by nesting two elements. For example, you can nest a <span>
inside the <a>
and put the itemprop="name"
on that:
<div itemscope itemtype="http://schema.org/Organization">
<a itemprop="url" href="http://www.ABCCompany.com/">
<span itemprop="name">ABC Company</span>
</a>
</div>
I find this site handy for testing such things.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With