Monday, 29 November 2010

Testing an HTML placement for third party sites

    Writing an HTML placement for third party sites used to be so easy. Back in the bad old days of tables and frames, you simply created a little table with all those nasty width, height, cellpadding and cellspacing attributes and called it good. You knew you had a pretty good chance of it working as you intended it to on pretty much any site it would be placed on.
    CSS has changed all that. Our HTML is much cleaner and easier to understand because all the styling and layout has moved into the style sheet, but placing outside code into a CSS page is now fraught with danger. The Cascading bit of Cascading Style Sheets means that the developer has to be extremely careful to ensure that no stone is left unturned and no opening has been created for a global style declaration to affect the placement styling. All of which leads to excessive amounts of inline styling that rather negates the point of CSS to create cleaner code.
    The placement below is an example. Created as a search box for the Oxford Dictionaries Online site, it should work with all modern browsers and degrade gracefully with older versions. But as all developers know, you can test something on everything you have and there will still be a platform out there that will trip you up.
    And true to form, on first load something's changed the formatting. Watch this space, CSS tweaking at work... Carriage returns replaced with <br> tags by the WYSIWYG editor. Lose the carriage returns and there it is.
    Oh well, that's Blogger ticked off the list of platforms it's been tested on.

No comments:

Post a Comment