Sure jQuery is Pretty, But Don’t Write Off CSS…

Have been teaching intro to jQuery a bit over the past two months, I have noticed that many of my students are quick to ditch the CSS hover pseudo-class once they discover the .hover() function. Sure .hover() is great and all, but CSS is built into the browser and thus you don’t need to load a script or execute a script in order for it to work. CSS is a powerhouse if you can get a little creative with it…

Many students counter this plea by pointing out functionality such as the every so sexy light box (as first named by Lokesh Dhakar and later expanded using the Prototype Library Scriptaculous in Lighbox 2.0). What is not widely know is that you CAN get a very similar effect (without the animation of course) using CSS only!! Stu Nicholls on his site CSSPlay illustrates this beautifully with his example of CSS only LightBox Galleries with and without a click (CSS LightBox WITH click & CSS LightBox WITHOUT click).

So next time you are developing a site, don’t just pass by CSS. Especially with the CSS3 features gaining acceptance, CSS is a very powerful tool. All it takes is a little creativity and imagination to make CSS work for you.

Happy coding!

Tags: , , , , , ,

Leave a Reply

You must be logged in to post a comment. If you do not have an account, contact me and I will be happy to set one up for you :)