Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Schema.org give a div a itemprop="image"?

I am replacing an image with a <div> with background-image for the reason of background-size: cover; The page is structured the same way as before with a image just that "the image" is a div now.

Does is makes sense to give that itemprop to a <div>?

like image 282
Wayne's World Avatar asked Aug 08 '13 16:08

Wayne's World


People also ask

What is the schema type for image?

In contemporary cognitive linguistics, an image schema is considered an embodied prelinguistic structure of experience that motivates conceptual metaphor mappings. Learned in early infancy they are often described as spatiotemporal relationships that enable actions and describe characteristics of the environment.

What does Itemprop mean in HTML?

The itemprop global attribute is used to add properties to an item. Every HTML element can have an itemprop attribute specified, and an itemprop consists of a name-value pair. Each name-value pair is called a property, and a group of one or more properties forms an item.

What's an example of the Itemtype attribute?

Item-type attributes are attributes that are applicable only to items of the same type. For example, collar size and sleeve size are attributes specific to shirts and waist and length attributes are specific to pants.

What is Itemscope tag?

itemscope is a boolean global attribute that defines the scope of associated metadata. Specifying the itemscope attribute for an element creates a new item, which results in a number of name-value pairs that are associated with the element.


2 Answers

CSS is not recognized by any Microdata parser that I'm aware of. You'll need to add a meta tag to specify the image like this:

<div itemscope itemtype="http://schema.org/Article">   <meta itemprop="image" content="bg.jpg"></meta>   <div style="background-image:url('bg.jpg')"></div> </div> 
like image 121
Shawn Simister Avatar answered Sep 21 '22 09:09

Shawn Simister


this is a good use for a meta tag within the containing div for your itemscope.

The two attributes you want in that meta tag are itemprop and content

<meta itemprop="image" content="/some/url/to/an/image.gif" /> 

You can verify that meta information is, in fact, read just fine by testing it here: http://www.google.com/webmasters/tools/richsnippets

like image 22
Kristian Avatar answered Sep 19 '22 09:09

Kristian