Bad HTML Style


Published on

  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Bad HTML Style

  1. 1. Bad HTML Style
  2. 2. What is good style? <ul><li>Good style, like good taste, is partly-- but only partly --a matter of opinion </li></ul><ul><li>Bad style is frequently easier to define </li></ul><ul><ul><li>A web page has bad style if </li></ul></ul><ul><ul><ul><li>You can’t load the page </li></ul></ul></ul><ul><ul><ul><li>You can’t use the page for its intended purpose </li></ul></ul></ul><ul><ul><ul><li>You can’t read the page </li></ul></ul></ul><ul><ul><ul><li>You can’t adjust the page to your needs </li></ul></ul></ul><ul><ul><ul><li>You can’t get rid of the page </li></ul></ul></ul><ul><ul><ul><li>You can’t navigate the site containing the page </li></ul></ul></ul>
  3. 3. Cannot load the page <ul><li>Macromedia Flash is the worst offender </li></ul><ul><li>Pages containing Flash animations often cannot even be loaded by browsers without Flash </li></ul><ul><ul><li>Some users just turn off Flash </li></ul></ul><ul><li>Java applets are much less popular than formerly </li></ul><ul><ul><li>Microsoft users don’t get modern Java by default </li></ul></ul><ul><li>If you are going to use Flash, applets, or other fancy features, make sure your intended audience has the ability to see your pages </li></ul><ul><li>Provide the essential information on your site in a form everyone can use! </li></ul>
  4. 4. Cannot use the page <ul><li>Many users turn off automatic image loading </li></ul><ul><ul><li>They may have a slow connection </li></ul></ul><ul><ul><li>They may be visually disabled </li></ul></ul><ul><ul><li>If your only hyperlink to another page is through an image, users without images cannot get there </li></ul></ul><ul><ul><ul><li>Always provide text hyperlinks in addition to your images </li></ul></ul></ul><ul><ul><li>Use the alt=&quot;text&quot; attribute in all your <img> tags </li></ul></ul><ul><li>Many users turn off JavaScript </li></ul><ul><ul><li>This is one way to avoid pop-up windows </li></ul></ul><ul><ul><li>JavaScript is useful for client-side input checking </li></ul></ul><ul><ul><li>Server-side input checking is slower but always works </li></ul></ul>
  5. 5. Cannot use with new technology <ul><li>Many “telephones” can access the Web </li></ul><ul><ul><li>Blackberry , Sidekick, iPhone, and now Android </li></ul></ul><ul><li>My Sidekick does JavaScript, but very poorly </li></ul><ul><ul><li>I can’t get flight information from the Philadelphia airport </li></ul></ul><ul><ul><li>I can’t access some weather sites </li></ul></ul><ul><ul><li>Some sites are useable but very cluttered (e.g. Amazon) </li></ul></ul><ul><li>For the most useful but unusable sites, alternative sites have come into existence </li></ul>
  6. 6. Cannot read the page <ul><li>Here are two otherwise very nice backgrounds: </li></ul><ul><li>Both of these backgrounds have text--can you see it? </li></ul>
  7. 7. Still cannot read the page <ul><li>Have you seen pages that tell you what browser to use and what to set your screen size to? </li></ul><ul><ul><li>Did you ever do it? </li></ul></ul><ul><ul><li>What do you think about that person’s ego? </li></ul></ul><ul><li>This page was created by someone with perfect eyesight using a 21-inch monitor set to 1600 by 1200 resolution, using an 8-point serif font, and as a result nobody but the original author has a clue what it actually says. </li></ul><ul><li>Some people just like to use weird fonts </li></ul><ul><li>7% of white males are red- green colorblind </li></ul><ul><ul><li>There are various other kinds of color blindness </li></ul></ul><ul><ul><li>Color is often a good differentiator, but it should never be the only differentiator </li></ul></ul><ul><li>There are lots of places you can use absolute sizes in HTML, but very little reason ever to do so </li></ul>
  8. 8. ADA (Americans with Disabilities Act) <ul><li>In the case of the National Federation of the Blind v. Target, Judge Marilyn Hall Patel ruled that retailers can be sued if their websites are not accessible to the blind . In her opinion for the US District Court for the Northern District of California, Patel wrote that “the ‘ordinary meaning’ of the ADA’s prohibition against discrimination in the enjoyment of goods, services, facilities or privileges, is that whatever goods or services the place provides, it cannot discriminate on the basis of disability in providing enjoyment of those goods and services.” </li></ul><ul><li>At issue is ’s lack of properly used “alt” tags throughout its site. </li></ul><ul><li>Source: </li></ul>
  9. 9. Contrast is important <ul><li>Contrast is important </li></ul><ul><ul><li>Use either very dark text against a very light background or very light text against a very dark background </li></ul></ul><ul><ul><li>Avoid contrast in the background itself </li></ul></ul><ul><li>If it has good contrast on your monitor, that doesn’t mean it will have good contrast on everyone else’s </li></ul><ul><ul><li>Always use more contrast than you think necessary </li></ul></ul><ul><li>The ability to read depends on edge detection </li></ul><ul><li>Human edge detection relies on contrast--differences between light and dark-- not on color differences </li></ul>This is a difference in color, not in contrast This is a difference in contrast, not in color
  10. 10. You can’t adjust the page <ul><li>Pages that use absolute sizes--for example, to adjust the size of a table to just fit on a 17-inch screen--are a serious nuisance </li></ul><ul><ul><li>Scrolling vertically is acceptable, because we don’t need to scroll often to read a column of text </li></ul></ul><ul><ul><li>If we need to scroll sideways, we need to scroll back and forth for every single line </li></ul></ul><ul><li>Relative sizes don’t always work, either; I’ve run across pages containing tables that are 110% of the page width </li></ul><ul><li>Even if your monitor is large and your eyesight is good, there may be other things on the screen that the user wants to see </li></ul>
  11. 11. You can’t leave the page <ul><li>Sometimes this occurs through malice--the page includes JavaScript to pop up a new window each time you close the current one </li></ul><ul><li>Usually it’s an accident: a page gives you an automatic transfer to a new page, but with the time set to zero: </li></ul><ul><li><meta HTTP-EQUIV=&quot;Refresh&quot; CONTENT=&quot; 0 ; URL=newURL&quot;> </li></ul><ul><li>This takes you to the new page but effectively disables the “Back” button </li></ul><ul><ul><li>Easy solution: Don’t set the time to zero! </li></ul></ul><ul><ul><li>User workaround: Use the drop-down menu next to the Back button to choose a page before the immediately previous page </li></ul></ul>
  12. 12. You can’t navigate the site <ul><li>EPSON used to be my favorite bad example (it’s gotten better now) </li></ul><ul><li>I wanted to download a printer driver; I went to and it gave me the following choices: </li></ul><ul><ul><li>Printers & Imaging products </li></ul></ul><ul><ul><li>Electronic devices </li></ul></ul><ul><ul><li>Point of Sale Products </li></ul></ul><ul><li>Which of these should I choose to find a printer driver? </li></ul><ul><li>Their page represents their corporate organization </li></ul><ul><ul><li>What do I care how they are organized? </li></ul></ul>
  13. 13. Workarounds <ul><li>Poor contrast: </li></ul><ul><ul><li>Hit control-A, to select all the text on the page </li></ul></ul><ul><ul><li>Otherwise, in Preferences, select “Use my chosen colors” and/or turn of image loading, then reload page </li></ul></ul><ul><ul><li>Use a Firefox add-on (I use Web Developer) to turn on or off various page styles </li></ul></ul><ul><li>Bad size: </li></ul><ul><ul><li>Increase or decrease screen resolution </li></ul></ul><ul><ul><li>On Mac OS X, use the mouse scroll wheel to zoom in or out </li></ul></ul><ul><li>Can’t leave the page with the Back button </li></ul><ul><ul><li>Use the pull-down list of pages you’ve been to </li></ul></ul><ul><li>Can’t navigate the site </li></ul><ul><ul><li>Use Google to search for particular information within the site </li></ul></ul>
  14. 15. The End I am a Web developer for a non-profit that is trying to help families with special health needs affected by Hurricane Katrina. Why in the world would FEMA, a federal agency subject to Section 508 provisions, build a web site that is only accessible via Internet Explorer for Windows? I know of no *good* technical reason to do so. In fact, if your web team is worth its salt, they should be developing to W3C standards anyway, which would mean that your web resources would be available to anyone with a web browser, even an old one on an old system! As a Macintosh user, I'm used to this kind of marginalization, but I find it outrageous that a resource as critical to people in desperate straits as this one would exclude millions of people for no reason other than ignorance of best practices. --Andrew Hedges