Needed to make HTML5 valid website

Make a HTML5 valid website is never easy. But you better do this because HTML5 is the future, get with it. Most of us are distress to create one or fix the problems.  You'll know how now

A DOCTYPE and filled title tag

Believe or not, you can have HTML5 page with only both of them. Of course without body, html, or head. Prove it now with W3 validator tool. Other side is, i know you don't want to have a website only contains a DOCTYPE and title tag. This just let you know

Escaped characters

Other easy way to do is escape ... characters like '&', '<', and '>'. There are so many tools you can use freely to escape ... characters like htmlescape.net.

Type attribute for script and style

I found my friend's blog doesn't HTML5 valid due to this. My blog also don't have type attribute for style and script but still valid HTML5. I suggest you to add it to avoid unexpected errors. Your code should look like
<style type='text'css'></style>
<script type='text/javascript'></script>

Avoid old HTML attributes & tags

Avoid old HTML attribute like font tag and color attribute. They are craps! Throw them far far far away. Use CSS instead. Not just at font tag and color attribute. There are still many not HTML5 tags and attributes you no need to use.

Make a good and clean organized code

This is more important. Don't code like sh*t, don't catch youself put everything without rules. Organized like
<ul>
<li></li>
</ul>
Easy right? only put li element inside ul don't break HTML5 rules!

Use schema.org correctly

Don't make a mistakes with schema.org or your website will never HTML5. Incorrect schema.org also affect you SEO score. Correct schema.org give you great benefits. Use itemprop attribute correctly based on your choosen schema.org category and also remember itemprop attribute must be filled.

Alt for img

Other problem that also affect SEO is this. Remember alt tag for all images, title tag also needed. I've write a post to help you add alt and title tag automagically for all images before, read here.

Don't use same ID for 2 or more elements

An "id" is a unique identifier. Each time this attribute is used in a document it must have a different value. If you are using this attribute as a hook for style sheets it may be more appropriate to use classes (which group elements) than id (which are used to identify exactly one element). Use class instead.

Last words

Keep optimizing. Don't too imposing to achieve this. Who cares HTML5 or not, this just the optimized / standard HTML document.

Komentar

Postingan populer dari blog ini

Is typekit really secure?

Rel="author" must only appear on post page

Lorem