Learn CSS fast - Stylin' with CSS has the theory and tutorials you need to master the art of Cascading Style Sheets
  • Home
  • Files by Chapter
    • Chapter 1
    • Chapter 2
    • Chapter 3
    • Chapter 4
    • Chapter 5
    • Chapter 6
    • Chapter 7
    • Chapter 8
  • XHTML templates
  • Javascript Goodies
  • Resources
    • Books
    • Links
  • Errata

Javascript Goodies

JavaScript is the third piece of interface programming; which I didn't have room to cover in this book, but will in Codin'; XHTML is used to define structure, CSS to define presentation, and Javascript to define behavior - real-time responses to user action. As you have seen from the book, the :hover psuedo-class of CSS enables rollover behaviors without use of JavaScript, although creation of behavior capabilities was not the intention of the W3C when CSS was developed. Still, this capability alone enables JavaScript to be avoided in many sites where it would otherwise have been used.

The only JavaScript in the book is used to make IE get in line with capabilities of more standards-compliant browsers.

csshover.htc is a JavaScript code that enables IE Windows to respond to the :hover pseudo-class on any element, instead of just links. Although it's JavaScript, it's added to your page using the behavior property on the body selector in your stylesheet, so it takes the .htc file suffix, rather than the ususal .js suffix. Read about how to use this file on page 193.

minmax.js enables IE to respond to the min-width and max-width properties, which enables you to prevent fluid layouts from reaching overly wide or narrow widths. Read how to use this file on page 251.

Download a .zip of the csshover.css and minmax.js files

 

 

This is the companion web site for the book "Stylin' with CSS - a designer's guide" published by New Riders Books, May 2005.

Read my blog

Buy additional copies of Stylin' with CSS from Amazon at reduced cost.

Stylin' with CSS - a designer's guide. A tutorial book on designing web pages with Cascading Style Sheets by Charles Wyke-Smith, published by New Riders Books.


Codin' for the Web now available!

Codin' for the Web - a designer's guide.

Codin' for the Web teaches programming techniques in XHTML, CSS, PHP and SQL to enable you develop the three-tier architecture (interface, middleware and database) that forms the basis of all modern web sites.

Visit the Codin' for the Web site.

Buy Codin'at Amazon.

  • © 2007 Charles Wyke-Smith - all rights reserved. Code samples are free for use by anyone.