Interviewer testing client side basics. During the interview the main objective is to show your knowledge, creative thinking and expertise.

This question is a great discussion point around CSS, cross-browser compatibility and proper UI design.

In general Cascading Style Sheets (CSS) is a way of defining styles on the web elements (e.g. colors, fonts, sizes, margins, puddings, etc). CSS is not a programming language and cannot be used to write code such as event handlers, etc. However such feature as DHTML behaviors can be used inside CSS to encapsulate specific functionality or behavior on a page.

According to MSDN Behaviors Provide a Means for Script Encapsulation and Code Reuse and can be used to add interactive functionality with a simple declarative syntax. This feature *can* be used to design and develop simple CSS slideshow.

General benefits of using behaviors:

1. Script Encapsulation and Code Reuse
2. Declarative Syntax
3. Script Isolation from Content
4. Easy-to-Create

Drawbacks of using behaviors:

1. Accessibility issues
2. Maintainability issues
3. Only supported by Internet Explorer
4. Non-standard (see above)

While there is a possibility to design and code simple CSS slideshow with hardcoded images by using behaviors I would never recommend doing this. This is great point to elaborate on scalability, x-browser, maintainability, ect.

What to use ? Use JavaScript and HTML instead.

The right approach would be to use HTML + CSS to design look and feel of the elements and JavaScript to load images for slideshow and for scrolling between images.

For example we can use JQuery JavaScript library to manipulate images and take benefits of the animation and effects components it provides.

Here is step-by-step instructions on making slideshow with jQuery and CSS:
http://tutorialzine.com/2010/03/mosaic-slideshow-jquery-css/

CSS_Slideshow.png






Answers and Comments