| Designing Cross Browser Compatible Websites - Designing Cross Browser Compatible Websites Pg 2 |
|
|
|
| Written by Handy PHP Administrator | |||||
| Sunday, 21 February 2010 18:56 | |||||
Page 2 of 2
Personally, I use XHTML 1.0 Transitional which I have much success with. It provides me with plenty of coding options but isn't so strict that my poor coding habits become a problem. I figured this all out one day when creating a template for Joomla! I wrote the pure HTML code first then adapted it to Joomla! The problem is that it looked different in pure HTML than it did when displaying Joomla! and I couldn't figure out why. My pure code didn't specify the HTML standard to use while the Joomla! template did specify a standard. So one version displayed using the browsers default rules and the other display using the standards rules.
To specify your coding standard, just replace your opening <html> tag with a bit more code. <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-gb" lang="en-gb" dir="ltr" > You can find more standards at http://www.w3.org.
The next step in creating a crows browser compatible website is to validate your HTML and your CSS. After all, how can you expect the browsers to display something correctly if you didn't code it properly. Validating not only points out coding errors to you, it will warn you when a bit of code isn't optimized for the standard you are using. Oddly, once you start validating, you'll see that several errors can be corrected with one change. Again, W3C is the place to validate your HTML and CSS. W3C Markup Validation Service W3C CSS Validation Service You'll be amazed with all of the information that these tools will provide. Using these tools and information, you'll soon find that getting your web pages to display correctly in all browsers is much less work.
|
|||||
| Last Updated on Sunday, 21 February 2010 20:05 |






