HEMANT SONKER'S BLOG

Friday, August 29, 2008

Web Standard Checklist

Web standards checklist
The term web standards can mean different things to different people. For some, it is 'table-free sites', for others it is 'using valid code'. However, web standards are much broader than that. A site built to web standards should adhere to standards (HTML, XHTML, XML, CSS, XSLT, DOM etc) and pursue best practices (valid code, accessible code, semantically correct code, user-friendly URLs etc).
In other words, a site built to web standards should ideally be lean, clean, CSS-based, accessible, usable and search engine friendly.
• Quality of code
1. Does the site use a correct Doctype?
A doctype (short for 'document type declaration') informs the validator which version of (X)HTML you're using, and must appear at the very top of every web page. Doctypes are a key component of compliant web pages: your markup and CSS won't validate without them
.
2. Does the site use a Character set?
If a user agent (eg. a browser) is unable to detect the character encoding used in a Web document, the user may be presented with unreadable text. This information is particularly important for those maintaining and extending a multilingual site, but declaring the character encoding of the document is important for anyone producing XHTML/HTML or CSS.

3. Does the site use Valid (X)HTML?
Valid code will render faster than code with errors. Valid code will render better than invalid code. Browsers are becoming more standards compliant, and it is becoming increasingly necessary to write valid and standards compliant HTML.

4. Does the site use Valid CSS?
You need to make sure that there aren't any errors in either your HTML or your CSS, since mistakes in either place can result in botched document appearance.
5. Does the site use unnecessary classes or ids?

6. Is the code well structured?
Semantically correct markup uses html elements for their given purpose. Well structured HTML has semantic meaning for a wide range of user agents (browsers without style sheets, text browsers, PDAs, search engines etc.)

7. Does the site have any broken links?
Broken links can frustrate users and potentially drive customers away. Broken links can also keep search engines from properly indexing your site.

8. How does the site perform in terms of speed/page size?

9. Does the site have JavaScript errors?
Internet Explore for Windows allows you to turn on a debugger that will pop up a new window and let you know there are javascript errors on your site. This is available under 'Internet Options' on the Advanced tab. Uncheck 'Disable script debugging'.
• Degree of separation between content and presentation
1. Does the site use CSS for all presentation aspects (fonts, colour, padding, borders etc)?
2. Are all decorative images in the CSS, or do they appear in the (X)HTML?
The aim for web developers is to remove all presentation from the html code, leaving it clean and semantically correct.

• Accessibility for users
1. Are "alt" attributes used for all descriptive images?
2. Does the site use relative units rather than absolute units for text size?
3. Do any aspects of the layout break if font size is increased?
4. Does the site use visible skip menus?
5. Does the site use accessible forms?
6. Does the site use accessible tables?
For data tables, identify row and column headers... For data tables that have two or more logical levels of row or column headers, use markup to associate data cells and header cells.
7. Is there sufficient colour brightness/contrasts?
8. Is colour alone used for critical information?
9. Is there delayed responsiveness for dropdown menus (for users with reduced motor skills)?
10. Are all links descriptive (for blind users)?

• Accessibility for devices
1. Does the site work acceptably across modern and older browsers?
2. Is the content accessible with CSS switched off or not supported?
3. Is the content accessible with images switched off or not supported?
4. Does the site work in text browsers such as Lynx?
5. Does the site work well when printed?
6. Does the site work well in Hand Held devices?
7. Does the site include detailed metadata?
8. Does the site work well in a range of browser window sizes?
• Basic Usability
1. Is there a clear visual hierarchy?
2. Are heading levels easy to distinguish?
3. Is the site's navigation easy to understand?
4. Is the site's navigation consistent?
5. Does the site use consistent and appropriate language?
6. Does the site have a sitemap page and contact page? Are they easy to find?
7. For large sites, is there a search tool?
8. Is there a link to the home page on every page in the site?
9. Are links underlined?
10. Are visited links clearly defined?
• Site management
1. Does the site have a meaningful and helpful 404 error page that works from any depth in the site?
2. Does the site use friendly URLs?

3. Do your URLs work without "www"?
While this is not critical, and in some cases is not even possible, it is always good to give people the choice of both options. If a user types your domain name without the www and gets no site, this could disadvantage both the user and you.


Benefits of valid XHTML & CSS
• Increased interoperability. XHTML pages can easily be viewed on wireless devices like PDA's and cell phones.
• Cleaner, more logical markup adding better integration in older existing systems.
• Future transition to more advanced technology. Allows future XML technology to be easily integrated in to an existing site.
• Greater accessibility, broadening your potential customer base. Pages will work with screen readers for the visually impaired.
• Bandwith conservation. Pages are smaller than old HTML designs and will load much faster for slower internet connections.
• Increased readability by search engines

Monday, August 25, 2008

CSS

What does CSS basically mean??

CSS mean Cascading Style Sheet.

Style sheets are a very powerful tool for the Web site developer. They give you the chance to be completely consistent with the look and feel of your pages, while giving you much more control over the layout and design than straight HTML ever did.


Style rules are comprised of two things, the selector and the declaration.

selector - The HTML tag that will be affected by the rule

declaration - The specific style calls that will affect the selector.

In CSS, selectors are used to declare which elements a style applies to, a kind of match expression. Selectors may apply to all elements of a specific type, or only those elements which match a certain attribute; elements may be matched depending on how they are placed relative to each other in the markup code.

In addition to these, a set of pseudo-classes can be used to define further behavior.The best-known of these is :hover, which applies a style only when the user 'points to' the visible element, usually by holding the mouse cursor over it. It is appended to a selector as in a:hover or #elementid:hover. Other pseudo-classes and pseudo-elements are, for example, :first-line, :visited or :before.

A declaration-block consists of a list of semicolon-separated declarations in braces. Each declaration itself consists of a property, a colon (:), a value, then a semi-colon (;).

But the question is what does cascading mean in CSS.??

Cascading is something that makes CSS even more powerful. Style sheets cascade when The Web Writer or user (or both) have created an order of precedence for the browser to apply the style rules in multiple sheets. The style rule or sheet that has the highest precedence is the one that is used. The following list is a simplification of how your browser decides precedence for a style:

  1. Look for the style element that is created, if it is not in the document, use the default rules in the browser.
  2. Determine if any of the style rules are marked as important and apply those to the appropriate elements.
  3. Any style rules in the document will have precedence over the default browser settings.
  4. The more specific the style rule, the higher the precedence it will have.
  5. Finally, if two rules apply to the same element, the one that was loaded last will have the highest precedence.