![]() ![]() |
Semantic Code - SEO and Beyond |
Mar 3 2007, 07:14 AM
Post
#1
|
|
|
Administrator ![]() ![]() ![]() Group: Root Admin Posts: 4,991 Joined: 25-January 07 Member No.: 1 |
Semantic Code is important for a number of reasons, but firstly let's define what we mean by semantic code.
Semantic Code - A term that refers to the practice of separating design and structure, or separating visual appearance vs content. Sometimes it is hard to pin down what is semantic code and what is not semantic code. Sometimes it is not so hard. Let's look at an example. CODE <font size="5" face="verdana" color="blue"><b><i>This is some important blue text!</i></b></font> Is this code valid? Yes, it is perfectly valid (if you are declaring an HTML doctype and not an XHTML doctype at least). Even with an XHTML doctype it will likely render fine in nearly all browsers. So why should we not use it? Well, there are several reasons, related to SEO, human visitors, and yourself. With respect to SEO, it is important to ensure that search engine spiders are seeing the content and understanding it as you wish for it to be portrayed. The above example prints out a rather large, bold, italic line of text. This is likely important text (else why would you make it so large?). The spider, however, can not really rank it's importance very effectively - you've just wrapped styling elements around the text - who knows how it important it should be. Can we rewrite the code so that search engine spiders understand how important it is, while still acheiving the same visual result? Of course! Otherwise, I'd have stopped typing already. CODE <h1>This is some important blue text!</h1> Viola! Now isn't that much neater and easier to read? Of course it is, and a spider will realize that since it's in an h1 header tag that it is important to your page's theme. But wait - that text won't be blue, bold, italic, and it may not even be the same size or font! Well, that's easy to fix, and this is how it should be done. Make a cascading style sheet, either inline in your HTML document, or linked to from your document (instructions on how to do so are outside the scope of this article) with the following definition: CODE h1 { color: blue; font-weight: bold; font-style: italic; font-size: 16px; font-family: verdana; } Now, we have nice clean HTML code that spiders (and us!) can read easily, while still presenting it to the user in the same visual fashion. Spiders will understand the importance of the text because we used the proper HTML tag to describe the text, and humans can still benefit from all your styling whims. Beyond spiders, however, semantic code is still very much beneficial. Here are some reasons -
|
|
|
|
![]() ![]() |
Similar Topics
| Topic Title | Replies | Topic Starter | Views | Last Action | |||
|---|---|---|---|---|---|---|---|
![]() |
0 | RSS Aggregator | 454 | 14th February 2007 - 10:10 PM Last post by: RSS Aggregator |
|||
![]() |
0 | RSS Aggregator | 503 | 16th February 2007 - 06:08 AM Last post by: RSS Aggregator |
|||
![]() |
7 | WoLeRiNe` | 991 | 28th July 2007 - 08:58 AM Last post by: WoLeRiNe` |
|||
![]() |
0 | RSS Aggregator | 298 | 30th March 2007 - 08:06 AM Last post by: RSS Aggregator |
|||
![]() |
0 | RSS Aggregator | 292 | 2nd April 2007 - 03:15 PM Last post by: RSS Aggregator |
|||
Links to this thread
|
Lo-Fi Version | Time is now: 1st December 2008 - 05:54 PM |