COURSE of the MONTH

css for closing popup

how do I add a simple css to close popup windows? The 3 product images (models ae, be and bte) in the chart open in a new window on click (added behavior). I would like to have the little "x" in top right corner to allow for someone to easily close window. Maybe that is something that I should do in behaviors?

Well instead of using popups which get blocked by users who use a popup blocker; why not use a div and then use a couple of CSS classes to show/hide the popup? Then you can use whatever markup you want to do layout and style. The x is just an icon with ckick event.

First off, CSS is not really capable of closing or opening anything - it's for presentation. If you want your pages to 'do' something, then you'll need to look at Javascript (jquery etc).

Secondly, opening a new window to show an image like that was popular back in the 90's but I haven't seen it done like that for such a long time. I can't believe DreamWeaver still produces code like that!

As Cd said, popups like this will often get blocked, so you're better off keeping everything 'in-page'. This is commonly called a lightbox effect, and a quick search around will point you to some javascript/css solutions - either as full packages you just include in your page, or tutorials showing you how to roll your own. It's not really that difficult

Not only will this look and feel much better, but your visitors will appreciate it a lot more - nothing more annoying than a site that opens extra windows.