Archive for the ‘Web Standards’ Category

Valid Flash Embed – Make That YouTube Embed Valid!

Hola! It’s been a while. I’ve got another gripe, and this time it’s with Flash embed code!

Most of the embed code I see for Flash movies is invalid, usually containing the non-existent embed element or some-such. Even the code provided by YouTube for embedding videos contains embed. This can easily be thrown out and will—probably most of the time—instantly make your code valid.

Here’s an example (in XHTML) of a valid Flash embed that works in at least IE6+, Firefox, and Safari:

<object data="flash.swf" type="application/x-shockwave-flash" width="320" height="240">
<param name="movie" value="flash.swf" />
</object>

That’s all there is to it. Adjust the parameters and add additional param elements as necessary. If your Flash movie requires variables, just add an extra param as follows:

<param name="flashvars" value="arg1=foo&amp;arg2=bar" />

If you place additional elements inside the object element, it will act as a fallback, displaying if the Flash plugin isn’t installed. For example:

<object data="flash.swf" type="application/x-shockwave-flash" width="320" height="240">
<param name="movie" value="flash.swf" />
<img src="fallback.jpg" alt="Flash Didn't Load!" />
</object>

That’s all for now. Happy coding!

—Kyle Blizzard

CSS Float Trick

Do you ever have a list of items (such as a ul) in which each item is floating to make them appear side-by-side (an example is the list of sites at BlizzardDigital.org)? Tired of using a non-semantic, empty div after the ul to clear the items? A useful trick is to add float: left; to the ul itself. This fits the ul‘s box around its inner items. Without float specified, the ul‘s box does not wrap around its items at all, making everything on the page after it scoot up behind all the list items. Very annoying. The normal fix for this would be to make the following element clear, but this isn’t always desirable. Your options are probably to have an empty div after it specifically to clear it (yuck) or make the probably unrelated following element clear it (yuck also). Just float the containing element (in my example, a ul) and set its width to 100%. The width makes sure no one squeezes in on the sides and therefore no clearing is necessary.

Clear as mud, right? 🙂

—Kyle Blizzard

Basic SEO For Everyone Chapter 3

[ Basic SEO: OneTwoThreeFourFive ]

As promised this will be about onpage and under the hood SEO basics. Starting at the top (of the html) we have the……… nope not the title, first let’s take a look at the Doctype. What does the Doctype have to do with SEO? Almost nothing but why not start out by telling the spiders what type of page you attempted to make and what type of code you are trying to write? It can’t hurt and might help them parse the page better. If you aren’t sure what the Doctype is then run over to the web standards authority and check it out and also read SEO and Validation.

OK, now the Title, what makes a good title? How is it used? The title will show in the title bar of most web browsers. There are not really any good statistics I’m aware of for how many people look at page titles when they are on your site but when they search, they are generally served your title in the Search Engine Results Page (SERP). We also know that Google, Yahoo, and Bing look at and put enough weight on your page title that it really matters. You can change your page title and only your page title and watch some of your search positions change, that’s how important the title is. If that’s true then why not SPAM the title? Simple, if I need a jack and the search results at position 4 is Jack : Lift : Heavy : Duty : Ultimate : Hydraulic and the position 5 result is The Ultimate Heavy Duty Hydraulic Jack by the JackMan then which one do you think gets more clicks? Another reason to make good titles is because the algorithms are very good at detecting SPAM and chances are you will do more harm than good if you just create stuffed titles. Moving on let’s decide what the page is about and craft a good title for humans and bots. For humans we need to strive for a complete sentence that makes sense and draws attention or demands action. Pick the topic of the page and try to get the main keywords or phrase in the first half of the title. Wow! All that in less than 70 characters including spaces, good luck. Good titles can be  a challenge but you will be rewarded for your effort. Try it, pick a product or service and try creating a title that would make you click it. After all, that is the goal, we want clicks because clicks equal traffic.

What about the page description meta tag? The search engines will most likely use your description to form the SERP description. Don’t copy the title, don’t use special characters. Include the main keywords or phrase for the page content. There is no penalty per se for a short description but you might be missing out on some keyword opportunities. Too little content could get a bot generated description that misses the point of your page. Take the opportunity to sell your product, service, or idea and use between 30 and 150 characters as a guideline.

The once powerful and now dusty and often forgotten keyword meta tag can still be useful so don’t completely neglect it. Put in your secondary keywords and key phrases, the ones that aren’t in your title and description. Limit duplicate words in phrases to 3. You can even include common typos. You can use up to 500 characters as a guideline but that’s probably more time than it deserves. I can’t tell you what search engine spyders still look at the keywords meta but there is some indication that Bing (Formerly MSN – Live Search) will grade your keywords but the weight is probably very low.

Well, I’m out of time so we will get to heading element, page content and copy writing in the next chapter.

—David Blizzard

SEO and Validation

I was reading The Truth About Validation and I felt the need to respond. First off, Tim makes some valid points but only if the article is renamed “The Truth About Validation and SEO”. I agree, if a web developer tells you that you can’t be much of an SEO if you don’t write valid code then that developer is a clown and should be ignored. If they are just saying that you are not a valid coder then that would be true. From a coder’s point of view they could go as far as saying that you are a hack, would they be wrong? That said, there are many other reasons to write valid code.  Some of the best SEO gods, gurus, evangelists, provide detailed change requests to web designers and this is often preferred on a valid site so the SEO does not break the valid code. Maybe SEO specialists should inform the client that there is such a thing as validation and let them decide. It’s similar to an auto mechanic letting the customer decide if they want a factory replacement part or an aftermarket part, is it worth the extra money? Determining that invalid pages are ranked high for certain terms does not tell the complete story but it does tell most of the story. What if a search bot reaches a certain point on a page that is so invalid it stops parsing? At that point the rest of your content would be ignored. What if the next algo revision applies more weight to valid code or is modified so that it halts when a missing end tag is encountered (is Bing already doing this)? You would have partial page results in the index which means you have wasted copy.  More important is the fact that invalid code might not render properly on the next update to your audience’s preferred browser. At some point the invalid code will probably rear its ugly head and then you will need to pay the piper to write valid code, or at least new code, so why not let the coders get paid for what they do?

We could argue that having a shade tree mechanic use bailing wire to fix a dragging muffler will allow you to use the car again but for how long? Yes it will cost more money to order the new muffler hanger and have a muffler shop install it properly but when you hit that big speed bump at the grocery store which one do you think will hold up? At that point did it really cost more money to have it done right?

I agree if you charge someone to do SEO work and you don’t write valid code then you aren’t ripping them off. What if you are upfront and tell them, directly, I am going to make the changes using invalid code, will they care? Should they have a choice or is OK to leave them in the dark since it is to your advantage?

One point Tim implied that I disagree with is that it’s more expensive to work on valid sites. It is much easier to work on a properly designed CSS and XHTML site than a hacked, table infested, monstrosity. We charge a lot more, well actually, we usually require a complete redesign before we start working on a hacked site but this is strictly related to design work, not SEO. Let me repeat here that I agree that validation has little to do with SEO if anything. I say if anything because we don’t know if any search engines pay greater weight to valid code and there can be a case made for a parser getting stuck or stopping after a bad or missing tag. Maybe not Google but can we guarantee this won’t happen with any search engine?

I give the thumbs up to valid code because without validation then you have to set some other standard for when the code is acceptable. It would be much more difficult to create a list of what code is bad or invalid but acceptable. Why not follow the standards that are used to design every web browser?

I also read “source code validation common sense” over at SEOBook by Aaron Wall. Wow! He really goes off and I don’t blame him but I have never personally heard a good web designer that is proud of his ability and trade claim that validation is an integral part of SEO work. I say ignore those monkeys but let the design experts maintain their status of elite, or cream of the crop, by writing valid code and proving they are at the top of their game just as you are at the top of yours. Here are some of the top reasons to validate.

added: I would be considered a hack when it comes to XHTML and CSS. If I perform onpage SEO I check to see if the client site is valid. If it is then I make sure it’s valid when I finish. Often I find errors that I have caused and then I have to employ someone from our design team to fix it. I have been known to render this site invalid just by blogging 🙂

—David Blizzard

More Random Web Design Tips

Body Element Classes

One thing I’ve started doing somewhat recently is adding a unique class name to the body element of each page. This allows me to write page-specific CSS as necessary without creating an extra stylesheet. Ideally, there should be styles for common elements that make up the site, rather than style for each page, but this can’t always be avoided. One case could be that a particular page needs to have a slightly different layout than the rest of the site. Body element class to the rescue!

Internet Explorer 6

We all know Internet Explorer 6 is a regular pain in the neck, right? Fortunately, it’s easy to add IE6-specific style with this selector:
* html [additional selectors...]

For example, the style * html p { font-weight: bold; } makes all paragraphs bold only in Internet Explorer 6.  It’s valid, but no other major browser will apply it. This is useful because sometimes the style needed to make things in IE6 look one way is drastically different than what is needed to make it look the same in all the other browsers. A simpler solution, though, is to tell your client to upgrade his 8-year-old browser. 🙂

“Navbars”

A site typically has a “bar” of navigational links. Vertically laid out navigation is easy to create and append additional links later. Horizontal navigation is sometimes desired instead, but it’s not always as trivial to append and can be a little trickier to achieve.

This tip will be focused on horizontal navigation. First, you should most definitely use unordered lists (the ul element) to organize your navigation links whether you’re using vertical, horizontal, upside-down, or anything-else-you-can-think of navigation. (See the W3’s excellent webmaster tips for more on unordered lists and their uses.) Once you’ve marked up your navigational links, jump over to the stylesheet and add a display: inline; line to your navigation’s li elements. Now take a step back and behold your now-horizontal navigational links!

If you find you need to set the width and height of your links, just set the display type of the a elements to inline-block, which I was surprised to find out was actually supported in Internet Explorer 6! Once you’ve set that, your links will behave like block-level elements as far as styling goes, but they will remain positioned inline. Sweet!

Well, that’s all for now. Make sure to check back occasionally for more random web tips from your Uncle Kyle!

—Kyle Blizzard