Log in

View Full Version : What standard to code to..?



ChuckRS
12-03-2015, 11:22 AM
I am revamping an old FrontPage site with Expression Web and the pages light up the screen with errors and incompatabilities. I copied text to Notepad to strip out old code and will create new tables. Data tables, stripped the old code with Notepad and EW till all I have is <table> <tr> <td> and the data.

The site will have close to 2,400 files but no complex coding, aside from the dynamic photo display and the drop down menu with submenus. Very few tags and mostly the basics. Some basic inline style (width, text-align etc).

For the drop down menu to work in IE8, had to change vertical spacing of the <a> tag to 0px and <a> submenu left spacing to 1. In Firefox had spacing between the buttons (no the list items). Also had to use Lucida something or other for a UTF-8 right triangle to work in IE8 (a pointer in a dropdown list of a submenu to the right)

Been going to W3schools for tag information where some attributes I looked at using are not supported by ver 5 html.

So with all that said, what standard should I code to (Xhtml, IE8, html5, 4.01 strict etc)? Since the code is pretty basic, any likely Firefox-IE8 incompatibilities?

Beverleyh
12-03-2015, 02:03 PM
HTML5 is the current standard so will give you the best footing going forward ('future-proofing' as far as you can). Old browsers will recognise the longer established tags fine - like paragraphs, tables, divs, headings, spans, anchors, etc. Only the newer HTML5 tags will be unrecognised - e.g. article, section, header, footer, nav - but you can serve a JavaScript shim in those cases, which will make IE7/8 play nicely with them too: https://www.google.co.uk/search?q=html5shiv - put it in the <head> section of your markup, between IE8 conditional comments so you're serving it only to the browsers that need it;
<!--[if lte IE 8]><script src="path/to/html5shiv.js"/></script><![endif]-->If you're not using new HTML5 elements, you don't need the shim but you can still use the HTML5 doctype to benefit from modern standards/consistencies.

For reference, if you're ever unsure about which HTML5 element or CSS property is supported in various browsers, head for the 'Can I Use' website http://caniuse.com/ type it in the search box and out will pop all the compatibility stats telling you where it's supported (or not). It's really useful :)

ChuckRS
12-03-2015, 06:42 PM
Thanks yet again Beverleyh. With what I learned deconstructing the old FP site, building the drop down menu, the Dynamic Drive dynamic photo display and your standards posting, I have a solid foundation on which to proceed with the new construction. Better to take the time upfront to learn than rush half-cocked into a project without enough understanding. Structure changes, unknowns and typo goofs will occur but I now have enough knowledge how the components work to solve them. If a problem still persists, I know where to go. Shall press on with construction

styxlawyer
12-03-2015, 11:22 PM
Once you have some pages to test you'll find the W3C Markup Validation Service (https://validator.w3.org) very useful.