, align=center or any depreceated html tags. it WILL make you trouble later.for Example: new mobile browsers will change it’s display with align=center for compatible mode, which you don’t want. use CSS for styling only!
Mobile-Ready Develop with mobile i7n mind! your HTML should viewed correctly on mobile, a-grade mobile, tablets and desktops. There are many ways to implement this, I like this method (using CSS Media Queries ):
`
`You can use JQuery either.
check this list of Media Queries Templates …
You can also use the @media meta to create different css for each device, but I like this method less.
<link rel="stylesheet" type="text/css" media="screen" href="screen.css" /> <link rel="stylesheet" type="text/css" media="print" href="print.css" /> <link rel="stylesheet" type="text/css" media="handheld" href="handheld.css" />
Also, add those two meta for set the page width as the device.
<meta name="HandheldFriendly" content="true" /> <meta name="viewport" content="width=device-width, height=device-height, user-scalable=no" />
Unobtrusive JavaScript Seperate the behavior from markup.
instead of:
<input type="text" name="date" onchange="validateDate()" />
Use this:
`
window.onload = function() { document.getElementById(‘date’).onchange = validateDate; };`
use namespaces for your js objects to avoid difficult to debug problems.
org.example = {};
read more here .
Tables Use tables for only what they are for: display data in a table style. don’t use it (borderless) to arrange your html. this is CSS task.
Cross-Browser It’s important to test your css on several (if not all popular) browsers while developing.
html shiv new tags likeoraren’t supported and css won’t effect for this tags in IE 8 or lower. to solve this issue just add to any html5 you need, right after the styles:
<!-- Pulled from http://code.google.com/p/html5shiv/ --> <!--\[if lt IE 9\]> <script src="//html5shim.googlecode.com/svn/trunk/html5.js"> </script> <!\[endif\]-->
Dynamic App Links Telephone (Dial) Link Did you knew you can link phones on your site to: dial on mobile and skype on pc?
<a href="tel:1234567890">Call (123) 456-7890</a> for handheld devices
Read about adding Meta tags to your website to support Windows-8.
Have fun HTML-ing…