30 Pure CSS Alternatives to Javascript

April 26, 2010 - 69 CommentsWritten by

With all the cool things that surround Javascript (especially with jQuery) its easy to forget that it’s possible to push pure CSS (with a touch of HTML) into an all singing and all dancing interactive site, with absolutely no scripting at all.

The pure CSS techniques, outlined in this article, are neither new nor are they ground-breaking. What they do offer is CSS solutions to what would typically and traditionally be associated with Javascript, and as a demonstration that they do exist and could be quite easily used.

Having said all that, we are in no way saying that these techniques are in anyway better than there Javascript equivalent, just an optional alternative and as a proof of concept.

In this article we have concentrated on showing as many varied CSS techniques that cover the full spectrum of web site interactivity, thus we have intentionally minimized the number of pure CSS navigation methods, of which there are literally hundreds.

CSS Image Map

CSS Image Map
While they may not be used as often as they once were in the heyday of HTML table based web design, image maps can still be quite useful in situations that call for it.
In this tutorial, you’ll be shown how to build a pure CSS image map with background image sprites and cap it all of with a "tooltip" like popup, all with CSS.

Pure CSS Timeline

Pure CSS Timeline
In this tutorial you will learn how to build a simple, clean and accessible pure CSS timeline with some very straight forward and basic markup.

Valid Non-Javascript Lightbox

Valid Non-Javascript Lightbox

Create a Content Slider Using Pure CSS

Create a Content Slider Using Pure CSS
As a proof of concept, this developer decided to experiment and create a working example of a CSS slider without the aid of any JavaScript, using layers in CSS and CSS3 transitions to give the slider the necessary animation.

A Stationary Logo That Changes on Page Scroll

A Stationary Logo That Changes on Page Scroll
The Econsultancy marketing blog has an interesting effect using CSS that allows their logo to change as the page is scrolled. You’ll notice the logo changes from a solid version to an outline version. This article will show you how this effect is achieved.

Bubble Effect with CSS

Bubble Effect with CSS
You might be familiar with the plugin jQuery Dock which allows you to create a menu like Apple Dock. With this tut, you will learn how to create a similar menu with bubble effect by using only pure CSS. The tutorial includes two methods: CSS sprites (basic) and image swapping (advanced).

Pure CSS Speech Bubbles

Pure CSS Speech Bubbles
Speech bubbles are a popular effect but many tutorials rely on presentational HTML or JavaScript. This tutorial contains various forms of speech bubble effects created with CSS2.1 and enhanced with CSS3. No images, no JavaScript and it can be applied to your existing semantic HTML.

SlickMap CSS — A Visual Sitemapping Tool

SlickMap CSS — A Visual Sitemapping Tool
SlickMap CSS is a simple stylesheet for displaying finished site maps directly from HTML unordered list navigation. It’s suitable for most web sites – accommodating up to three levels of page navigation and additional utility links – and can easily be customized to meet your own individual needs, branding, or style preferences.
The general idea of SlickMap CSS is to streamline the web design process by automating the illustration of site maps while at the same time allowing for the pre-development of functional HTML navigation.

Perfect Full Page Background Image

Perfect Full Page Background Image

Accordion Using Only CSS

Accordion Using Only CSS
An accor­dion effect can be achieved using CSS3’s :target pseudo-class, without needing JavaS­cript. Using the pro­pri­et­ary -webkit-transition prop­erty this accor­dion can also be animated.
Each part of the accor­dion has an ID, head­ing and con­tent region. The header includes a link that matches the section’s ID, whilst the con­tent is wrapped in a con­tainer which will con­trol its display.

Social Media Icons in Pure CSS

Social Media Icons in Pure CSS
These icons are a phenomenal example of what can be achieved with CSS. Yes, those social media icons really are created using only CSS and HTML markup.

Pure Css Data Chart

Pure Css Data Chart
Data visualization is mostly achieved with flash applications or with help of some programming languages. Are those solutions the only way to present, let's say simple data chart? How about giving it a try with nothing but good ol' css?

CSS Bar Charts

CSS Bar Charts
Bar charts in CSS are neither very new, or very difficult. Using some pretty basic styling you can force lists etc into resembling graphs and charts fairly easily. Such charts, in their most basic form, work perfectly well in displaying and presenting the data they represent. However, using some rich CSS3 and progressive enhancement, you can really start pushing the display and presentation of these normally boring documents to the next level.

Pure Css Line Graph

Pure Css Line Graph
The intention of this tutorial was not only to enable data visualization to people that don't feel comfortable with using various scripting languages but also to demonstrate the power of CSS and present a way of using CSS a bit differently.

Pure CSS Animated Progress Bar

Pure CSS Animated Progress Bar
Here's a simple demonstration of how you can create an animated progress bar using pure CSS. The trick is very simple, all you need is 3 elements, one container and 2 nested elements.

CSS Navigation: No JavaScript, jQuery or Image Required

CSS Navigation: No JavaScript, jQuery or Image Required

Add a “Loading” Icon to Larger Images

Add a “Loading” Icon to Larger Images
Let’s say that you have a large image (or several large images) on a particular page, and you want to let visitors know that the image is loading.
You could use Javascript to embed a “loading” image for all of the images that have not yet loaded, but unless you are loading a lot of large images on a single page, you could use the simpler and cleaner metod by using only CSS.

Super Awesome Buttons

Super Awesome Buttons
The technique, from Zurb, for these 'Super Awesome' CSS buttons, use descriptive class names and the CSS3 properties gradients and box shadows. And with a little more refinement, they have made these buttons look more actionable and refined while maintaining the ability to function as a button across browsers.

CSS-Only Tabbed Area

CSS-Only Tabbed Area
When you think of “tabs”, your mind might will always head straight for JavaScript. Watch for a click on a tab, hide all the panels, show the one corresponding to tab just clicked on. All major JavaScript libraries tackle tabs in some way. Is there is a way to accomplish this same idea with “pure CSS”. Of course there is.

Clean and Pure CSS FORM Design

Clean and Pure CSS FORM Design
It is simpler and faster to use HTML table structures for forms rather than using only CSS properties. In any case, for CSS lovers, this tutorial illustrates a technique for a pure CSS form without using HTML tables.

Pure CSS Vignette

Pure CSS Vignette
For those of you who don’t know, a vignette effect is a discoloration on the edges of an image. This effect usually appears in photography and it can be either accidental or intentional. The technique involves a few divs, a bit of simple CSS, and a whole lot of fun.

Pure CSS Scrollable Table with Fixed Header

Pure CSS Scrollable Table with Fixed Header

Beautiful Dropdown Blogroll Without JavaScript

Beautiful Dropdown Blogroll Without JavaScript

Pure CSS Sticky Footer

Pure CSS Sticky Footer

“Checkmark” Your Visited Links with Pure CSS

“Checkmark” Your Visited Links with Pure CSS
Web browsers know which links on a page have been visited by a user (until the cache is cleared out, that is). It is up to you the designer to take advantage of that web browser’s knowledge, if you choose to do so. The goal of this tutorial is to have a check mark preceding visited links for a nice visual indicator using only CSS.

Sexy Bookmark Effect Using Pure CSS

Sexy Bookmark Effect Using Pure CSS

Text Rotation with CSS

Text Rotation with CSS

CSS Sprite Powered Menu

CSS Sprite Powered Menu

Curtis CSS Typeface

Curtis CSS Typeface
Curtis is the name given to a family of geometric sans-serif fonts currently in development. Other incarnations exist as Fontstructions: Curtis Heavy and Curtis Pixel 14. This version takes the form in CSS, yes, only CSS! All shapes are rendered by the browser, using a combination of background color, border width, border radius, and a heavily reliance on absolute/relative positioning.

Elegant Drop Menu with CSS Only

Elegant Drop Menu with CSS Only
You will be able to find lots of tutorials that can help build a navigation with dropdown effect by using Javascript. In this tutorial, you will see a simpler method using only CSS.

Snazzy Hover Effects Using CSS

Snazzy Hover Effects Using CSS
With all of the CSS3 effects and tutorials popping up every day that show all the new and wonderful things we can make happen, we sometimes forget about poor little old CSS2.1 and the great potential it still has. With this tutorial, you will learn how to build and use flexible and advanced hover techniques using CSS2.1 properties.

You might also like…

15 CSS3 Navigation and Menu Tutorials and Techniques »
20 CSS3 Tutorials and Techniques for Creating Buttons »
24 CSS (in some cases with jQuery) Navigation and Menu Tutorials »
22 CSS Button Styling Tutorials and Techniques »
CSS References, Tutorials, Cheat Sheets, Conversion Tables and Short Codes »
50 Useful Tools and Generators for Easy CSS Development »
50 Essential Web Typography Tutorials, Tips, Guides and Best Practices »
The Blueprint CSS Framework – Tutorials, How-to Guides and Tools »
20+ Resources and Tutorials for Creative Forms using CSS »

About the Author: (833 Articles)

Paul Andrew is the editor and founder of Speckyboy Design Magazine. You can follow Speckyboy on Twitter, on Facebook, on Digg or you can subscribe via RSS.

Comments and Reactions

  • Pingback: 30 Pure CSS Alternatives to Javascript » Javascript, Direct, Link, What, HTML, jQuery » RMDsite

  • http://www.nicolebauer.com Nicole Bauer

    This is an excellent list! Some very useful techniques. I was really surprised how much you can achieve with pure CSS. Thanks a lot!

  • http://aext.net AEXT.NET MAGAZINE

    Great and thanks for including my two tutorials here! Cheer!

  • http://www.1bnet.de Stephan Kreis

    super sache – einfach immer wieder sauber

  • http://elainevellacatalano.com Elaine

    Very useful, thanks!

  • http://thesharklady.com/tech The Shark Lady

    Wonderfully useful list! Thanks.

  • http://www.thomascraigconsulting.com Thomas Craig Consulting

    Nice collection, thanks for sharing.

  • Icehawg

    The title, and individual descriptions, are misleading. Very few of these are “CSS” only. Most of them require jquery, at a minimum, to function so by extension they require also javascript.

    • Paul Andrew

      I would love to know which ones use jQuery? By my eyes none of them do.

  • Pingback: 30 Pure CSS Alternatives to Javascript | TopRoundups

  • http://jireck.free.fr Jireck

    Excellent !!! nice !!!

  • http://colincavaliere.com Colin Cavaliere

    This is a great list of CSS features. I was not aware of even having the ability to make a graph with only CSS.
    thanks!

  • http://www.bloggermint.com Franklin Manuel

    Awesome collection, I am really amazed to see the possibilities of CSS.

  • Pingback: 30 Pure CSS Alternatives to Javascript | 10 popular

  • http://blog.insicdesigns.com insic

    Great round-up Paul.

    Thanks for the include :)

  • http://nicolasgallagher.com Nicolas Gallagher

    Thanks for including one of my articles.

    I also put together an improved version of Social Media Icons via CSS. Uses semantic HTML and meaningful link text:

    http://nicolasgallagher.com/experimental-pure-css-social-media-icons/

  • http://design-creators.net Alexander Trefz

    Nice. But the Question is: WHY? Why just dont use JS?

  • Pingback: 30 Pure CSS Alternatives to Javascript – Speckyboy Design Magazine | とっても! ちゅどん(雑記帳)

  • http://www.alejandrobriz.es Alejandro Briz

    Muy buen post, me ha gustado mucho. Buen trabajo.

  • Daniela

    It’s articles like this that remind me how fortunate I am to love what I do.

  • http://www.deluxeblogtips.com/ Deluxe Blog Tips

    I found some interesting of using CSS in this post, like making social icons with CSS & HTML, creating animated bar, sexy bookmarks. I love CSS, and would like to use it instead of javascript if it can be.

    Thank you very much for sharing.

  • Pingback: 30 alternatives purement CSS à Javascript

  • Pingback: links for 2010-04-26 « 個人的な雑記

  • Pingback: Posts de CSS3 y Pure CSS que me quitan el sueño | Cookieface

  • http://www.ashocka.co.cc/ aShocka

    wow, absolutely awesome! :O *tweet*

  • http://loneplacebo.com Tony

    Muy excelente!

  • http://surferzworld.com Surferz World

    Awesome info, I never expected this many possibilities from CSS, useful info for web masters.

  • Pingback: links for 2010-04-26 « Mandarine

  • http://www.studioweber.ro Alex Flueras

    Excellent roundup. CSS rules! Thanks.

  • Pingback: freewebdev.jp

  • http://www.webexpertzone.com srikrish

    Nice one!very useful..

  • http://www.webdeveloperjuice.com/ designfreek

    Thanks Paul for the include.. :)

  • http://www.instantfundas.com Kaushik

    Wow! I never knew these were possible without Javascript.

  • http://www.estudio.lemonaudiovisual.com ks

    Superlative list…thanks for sharing your knowledge :D

  • http://www.webcoursesbangkok.com Carl – Web Courses Bangkok

    I`m loving the re-birth of people talking about CSS and now with CSS3 we can expect a lot more great posts like this.

  • http://www.profeval.com Derrick

    Very nice collection! Thanks!

  • http://www.kreative.net.in Kamal

    I love this post. Truly awesome. Thanks a lot for sharing.

  • Pingback: t3n-Linktipps: WordPress-Umzug, JavaScript vs CSS, Social-Media-Fehler, Flattr im Test und Akzeptanz von Paid Content » t3n News

  • http://www.blastingmind.com/ Blasting Mind

    I am very amazed how CSS creates awesome images!

  • Pingback: links for 2010-04-27 » 4exp.net

  • Pingback: Linkschleuder 10-04-27 – freeQnet

  • http://www.seo-julie.co.uk Julie Cheung

    Love this. I’m particularly interested in the accordion, tabs and the gradient buttons. Thanks! :)

  • Pingback: davidvoegtle.net » Blog Archive » Daily links 04/28/2010

  • http://www.juegos.gs Juegos

    What we see on this page isn’t css, this is pure magic. Excellent.

  • Pingback: Pensievin’ » links for 2010-04-28

  • http://twitter.com/nvitou nVitou

    It is very nice. Thanks for these.

  • Pingback: 30 Pure CSS Alternatives to Javascript – Speckyboy Design Magazine | Source code bank

  • Pingback: 30 Pure CSS Alternatives to Javascript – Speckyboy Design Magazine | My Blog

  • http://www.cssgallerysubmission.com Css Gallery Submission

    Wow, I’m surpised. The power of CSS3. Thanks for sharing

  • http://www.lytecube.com/lyterad Girish

    Amazing techniques, I’ve been messing with javascript for so long that I could’nt imagine doing this in css. Thx for the excellent article ..

  • Pingback: [Web] 連結分享 - 傑夫碎碎唸-有線電視、漫畫、PHP、Pushmail、Blackberry

  • http://ghafoory.com ebad

    very nice
    very useful

  • Pingback: Linkhub – Woche 17-2010 - pehbehbeh

  • Pingback: CSS Web Design | Web Courses Bangkok

  • Pingback: Latest 20 Quality Web Articles | Web Courses Bangkok

  • Pingback: 50 alternative CSS a JavaScript | Mr.Webmaster – Blog

  • http://victorkravtsov.com/ Victor

    Great article! I also often use
    Pure CSS menu – purecssmenu.com – easy and fun.

  • Pingback: 40+CSS Ressourcen/Tutorials,Tips und Tricks | GFC Theme

  • http://motyar.blogspot.com MOTYAR MAGAGINE

    Great article!
    But not working with all browsers as JS.

  • http://www.mpsantoshkumar.info santosh kumar

    nice one

  • http://leaflette.org leaflette

    Very nice! love these all.
    I prefer using css better than jquery, clean and simple yet lighter than jquery :)

  • http://www.digital-results.com/ Russell Bishop

    There are some very nice little CSS techniques here, but the article seems to have lost focus. ‘css alternatives to JavaScript’.

    Form design? Buttons? Icons? What kind of JavaScript are they replacing?

    • http://mladenkalinic.wordpress.com Mladen Kalinic

      I love the way only 1 person noticed that some of these aren’t JavaScript replacements, and only one other person noted that some of these don’t have browser compatibility of JavaScript.

      Everyone else was like ‘WWWow!’, ‘Magic!’, ‘Unicorn farts!’.

      Everything has it’s purpose, meaning what is best used for, so does CSS.

  • http://www.thebrisbaneline.com Web design portfolio of Evan Skuthorpe

    some great techniques but some of the final outcomes look like they were coded rather than designed, if you know what i mean. reminds me of the DHTML era.

  • http://www.debsinc.com Danny Nicholas

    Excellent presentation – BUT!!! 30 “alternatives to javascript” shouldn’t have imbedded (from google analytics?) javascript. That’s like saying “let’s show you how to quit using tables, but our demo is going to use them anyway” – Guess I’m just “nit-picky”.

  • http://www.oberkaernten.info Zengi

    so nice, thanks a lot

  • Pingback: 30 javascript alternatives with pure css | CREATIVE TWEETS

  • http://jade.se Resa

    continue with the the nice work on the blog. I like it. Could use some more frequent updates, but i am quite sure that you have got other things stuff to do , hehe. =p

  • Pingback: pure css | picas to pixels