Thiết kế web | Dịch vụ SEO | Quản trị web | Tên miền | Lưu trữ website | Quảng bá web | Thiết kế web top google |
Posted: 16 Jan 2012 12:12 PM PST code chuẩn seo? bạn đã nắm vững kiến thức html chuẩn seo chưa? bài viết sau đây giúp bạn có 1 code html gọn nhẹ và chuẩn với Google .1. How to mark up your content using microdata1a. Why use microdata?Your web pages have an underlying meaning that people understand when they read the web pages. But search engines have a limited understanding of what is being discussed on those pages. By adding additional tags to the HTML of your web pages—tags that say, “Hey search engine, this information describes this specific movie, or place, or person, or video”—you can help search engines and other applications better understand your content and display it in a useful, relevant way. Microdata is a set of tags, introduced with HTML5, that allows you to do this. 1b. itemscope and itemtypeLet’s start with a concrete example. Imagine you have a page about the movie Avatar—a page with a link to a movie trailer, information about the director, and so on. Your HTML code might look something like this: <div> <h1>Avatar</h1> <span>Director: James Cameron (born August 16, 1954)</span> <span>Science fiction</span> <a href="../movies/avatar-theatrical-trailer.html">Trailer</a> </div> To begin, identify the section of the page that is “about” the movie Avatar. To do this, add the itemscope element to the HTML tag that encloses information about the item, like this: <div itemscope> <h1>Avatar</h1> <span>Director: James Cameron (born August 16, 1954) </span> <span>Science fiction</span> <a href="../movies/avatar-theatrical-trailer.html">Trailer</a> </div> By adding But it’s not all that helpful to specify that there is an item being discussed without specifying what kind of an item it is. You can specify the type of item using the <div itemscope itemtype="http://schema.org/Movie"> <h1>Avatar</h1> <span>Director: James Cameron (born August 16, 1954)</span> <span>Science fiction</span> <a href="../movies/avatar-theatrical-trailer.html">Trailer</a> </div> This specifies that the item contained in the div is in fact a Movie, as defined in the schema.org type hierarchy. Item types are provided as URLs, in this case 1c. itempropWhat additional information can we give search engines about the movie Avatar? Movies have interesting properties such as actors, director, ratings. To label properties of an item, use the <div itemscope itemtype ="http://schema.org/Movie"> <h1 itemprop="name">Avatar</h1> <span>Director: <span itemprop="director">James Cameron</span> (born August 16, 1954)</span> <span itemprop="genre">Science fiction</span> <a href="../movies/avatar-theatrical-trailer.html" itemprop="trailer">Trailer</a> </div> Note that we have added additional Search engines can now understand not just that http://www.avatarmovie.com is a URL, but also that it’s the URL for the trailer for the science-fiction movie Avatar, which was directed by James Cameron. 1d. Embedded itemsSometimes the value of an item property can itself be another item with its own set of properties. For example, we can specify that the director of the movie is an item of type Person and the Person has the properties <div itemscope itemtype ="http://schema.org/Movie"> <h1 itemprop="name"&g;Avatar</h1> <div itemprop="director" itemscope itemtype="http://schema.org/Person"> Director: <span itemprop="name">James Cameron</span> (born <span itemprop="birthDate">August 16, 1954)</span> </div> <span itemprop="genre">Science fiction</span> <a href="../movies/avatar-theatrical-trailer.html" itemprop="trailer">Trailer</a> </div> 2. Using the schema.org vocabulary2a. schema.org types and propertiesNot all web pages are about movies and people—in addition to the Movie and Person types described in section 1, schema.org describes a variety of other item types, each of which has its own set of properties that can be used to describe the item. The broadest item type is Thing, which has four properties: Here’s a set of commonly used item types:
You can also see a full list of all item types, listed on a single page. 2b. Expected types, text, and URLsHere are a few notes to keep in mind when adding schema.org markup to your web pages.
2c. Testing your markupMuch like a web browser is important for testing changes to your web page layout, and a code compiler is important for testing code you write, you should also test your schema.org markup to make sure it is implemented correctly. Google provides a rich snippets testing tool, which you can use to test your markup and identify any errors. 3. Advanced topic: Machine-understandable versions of informationMany pages can be described using only the However, sometimes an item property is difficult for a machine to understand without additional disambiguation. This section describes how you can provide machine-understandable versions of information when marking up your pages.
3a. Dates, times, and durations: use the time tag with datetimeDates and times can be difficult for machines to understand. Consider the date “04/01/11″. Does it mean January 11, 2004? January 4, 2011? Or April 1, 2011? To make dates unambiguous, use the <time datetime="2011-04-01">04/01/11</time> You can also specify a time within a day, using the <time datetime="2011-05-08T19:30">May 8, 7:30pm</time> Let’s see this in context. Here’s some HTML describing a concert taking place on May 8, 2011. The Event markup includes the name of the event, a description, and the date of the event. <div itemscope itemtype="http://schema.org/Event"> <div itemprop="name">Spinal Tap</div> <span itemprop="description">One of the loudest bands ever reunites for an unforgettable two-day show.</span> Event date: <time itemprop="startDate" datetime="2011-05-08T19:30">May 8, 7:30pm</time> </div> Durations can be specified in an analogous way using the <time itemprop="cookTime" datetime="PT1H30M">1 1/2 hrs</time>
The date, time, and duration standards are specified by the ISO 8601 date/time standard. 3b. Enumerations and canonical references: use link with hrefEnumerationsSome properties can take only a limited set of possible values. Programmers often call these “enumerations.” For example, an online store with an item for sale could use the Offer item type to specify the details of the offer. The Here is an item for sale, marked up with the Offer type and relevant properties: <div itemscope itemtype="http://schema.org/Offer"> <span itemprop="name">Blend-O-Matic</span> <span itemprop="price">$19.95</span> <span itemprop="availability">Available today!</span> </div> And here is the same item, but using <div itemscope itemtype="http://schema.org/Offer"> <span itemprop="name">Blend-O-Matic</span> <span itemprop="price">$19.95</span> <link itemprop="availability" href="http://schema.org/InStock"/>Available today! </div> Schema.org provides enumerations for a handful of properties—typically wherever there are a limited number of typical values for a property, there is a corresponding enumeration specified in schema.org. In this case, the possible values for Canonical referencesTypically, links are specified using the <div itemscope itemtype="http://schema.org/Book"> <span itemprop="name">The Catcher in the Rye</span>— by <span itemprop="author">J.D. Salinger</a> Here is the book's <a itemprop="url" href="http://en.wikipedia.org/wiki/The_Catcher_in_the_Rye">Wikipedia page</a>. </div> As you can see, However, you might not want to add a visible link on your page. In this case, you can use a <div itemscope itemtype="http://schema.org/Book"> <span itemprop="name">The Catcher in the Rye</span>— <link itemprop="url" href="http://en.wikipedia.org/wiki/The_Catcher_in_the_Rye" /> by <span itemprop="author">J.D. Salinger</span> </div> 3c. Missing/implicit information: use the meta tag with contentSometimes, a web page has information that would be valuable to mark up, but the information can’t be marked up because of the way it appears on the page. The information may be conveyed in an image (for example, an image used to represent a rating of 4 out of 5) or a Flash object (for example, the duration of a video clip), or it may be implied but not stated explicitly on the page (for example, the currency of a price). In these cases, use the <div itemscope itemtype="http://schema.org/Offer"> <span itemprop="name">Blend-O-Matic</span> <span itemprop="price">$19.95</span> <img src="four-stars.jpg" /> Based on 25 user ratings </div> Here is the example again with the rating information marked up. <div itemscope itemtype="http://schema.org/Offer"> <span itemprop="name">Blend-O-Matic</span> <span itemprop="price">$19.95</span> <div itemprop="reviews" itemscope itemtype="http://schema.org/AggregateRating"> <img src="four-stars.jpg" /> <meta itemprop="ratingValue" content="4" /> <meta itemprop="bestRating" content="5" /> Based on <span itemprop="ratingCount">25</span> user ratings </div> </div> This technique should be used sparingly. Only use 3d. Extending schema.orgMost sites and organizations will not have a reason to extend schema.org. However, schema.org offers the ability to specify additional properties or sub-types to existing types. If you are interesting in doing this, read more about the schema.org extension mechanism. |
You are subscribed to email updates from Thiết kế website, thiet ke website To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google Inc., 20 West Kinzie, Chicago IL USA 60610 |