Powerful CSS-Techniques For Effective Coding

Advertisement

Sometimes being a web-developer is just damn hard. Particularly coding is often responsible for slowing down our workflow, reducing the quality of our work and sleepless nights with pizza and coffee laying around the laptop. Reason: with a number of incompatibility issues and quite creative rendering engines it sometimes takes too much time to find a workaround for some problem without addressing browsers with quirky hacks. And that’s where ready-to-use solutions developed by other designers come in handy.

One year ago we’ve published the post with 53 CSS-Techniques You Couldn’t Live Without where we provided references to the most useful CSS-techniques which are often used in almost every project. Over the last year we’ve been observing what’s happening with the CSS-based web-development, and we collected most useful CSS-techniques we’ve stumbled upon — for us and for our readers.

In this post we present 50 new CSS-techniques, ideas and ready-to-use solutions for effective coding. You definitely know some of them, but definitely not all of them. Some technique is missing? Let us know in the comments to this post.

Thanks to all developers who contributed to the CSS-based design over the last year. The community appreciates it.

CSS-Techniques

1. Triadic Background Setting with CSS
The Silverback web site uses three background images to create the illusion of 3D with simple CSS. No documentation is provided, however the source code is quite intuitive. [via Wilson Miner]

CSS-Technique

2. Creative Use of PNG Transparency in Web Design
With proper PNG support in Internet Explorer 7, and some handy JavaScript and CSS tricks to account for older browsers, we can use PNG images to greatly enhance our design vocabulary.

CSS-Technique

3. CSS Server-Side Pre-Processor

CSS-Technique

4. Advanced CSS Menu

CSS-techniques - Advanced CSS Menu

5. CSS SiteMap

CSS-techniques - beTech » CSS SiteMap » Oct 3, 2007

6. Styling File Inputs with CSS and the DOM
File inputs (<input type=”file” />) are the bane of beautiful form design. No rendering engine provides the granular control over their presentation designers desire. This simple, three-part progressive enhancement provides the markup, CSS, and JavaScript to address the long-standing irritation.

CSS-Technique

7. A Savvy Approach to Copyright Messaging
Derek Powazek suggests adding a copyright message to a photo and use CSS to crop its view. This is supposed to accomplish the goal of adding robust copyright information without defacing your own work.

Screenshot

8. Particletree Category List

CSS-techniques - Particletree » Automatically Version Your CSS and JavaScript Files

9. Advanced CSS Menu Trick
What we want to do here, is instead of simply altering the state of the navigation item the user is currently rolling over, we want to alter the non navigation items as well.

Screenshot

10. CSS hover effect

CSS-techniques - CSS hover effect | Veerle's blog

11. Creating a table with dynamically highlighted columns like Crazy Egg’s pricing table

CSS-techniques - Creating a table with dynamically highlighted columns like Crazy Egg's pricing table

12. A Stripe of List Style Inspiration
A different type of list and navbar styling. As stripes.

CSS List Style

13. Rediscovering the Button Element

CSS-techniques - Particletree » Rediscovering the Button Element

14. Dynamic CSS With Variables
Geoffrey Grosenbach describes how you can integrate CSS variables in CSS coding — with Ruby on Rails.

Dynamic CSS

15. Hyperlink Cues with Favicons
I wanted to extend the concept of hyperlink cues a little. For links that point to external sites, what if, instead of showing a generic ‘external link’ icon, we showed that site’s favicon?

CSS-techniques - Drop Shadow CSS

16. A CSS styled table version 2

CSS-techniques - A CSS styled table version 2 | Veerle's blog

17. CSS Step Menu
A method of designing the so-called step-menus, which have some steps users have to go through in order to achieve some aim. This menu offers a varying amount of steps, dependent upon the type of user accessing the application.

Stepmenu

18. Creating bulletproof graphic link buttons with CSS | 456 Berea Street

CSS-techniques - Creating bulletproof graphic link buttons with CSS | 456 Berea Street

19. Iconize Textlinks with CSS
Links are fun, but sometimes we don’t know where they take us. With this little CSS technique a user can identify a link by its icon. The updated release of the technique.

Screenshot

20. Better Ordered Lists (Using Simple PHP and CSS)
Ordered lists are boring! Sure you can apply background images and do quite a bit of sprucing up to a regular ordered list, but you just don’t get enough control over the number itself.

Screenshot

21. Circular Menu with CSS
This article shows how a beautiful circular navigation menu is created. In Spanish with Source code and an example.

Circular Menu with CSS

22. CSS Dock Menu

CSS-techniques - CSS Dock Menu

23. Digg-like navigation bar using CSS
This tutorial explains how to design a digg-like navigation bar using a liquid design with rounded corners for links.

Screenshot

24. 13 Awesome Javascript CSS Menus
13 “fresh” JavaScript+CSS-based navigation menus in a brief overview. Among other things Slashdot Menu and Sexy Sliding Menu displayed below.

CSS Menu

25. CSS Pricing Matrix
A CSS-based matrix in which clicking on a highlights the associated cell in the top row and left column giving an indication of relationships among the provided information. Similar solution: Tablecloth.

CSS Pricing Matrix

26. CSS List Expander
So, we have an unordered list that can go on in depth as much as we want. The script analyzes the list tree and applies toggle functions for expanding/collapsing child objects.

List Expander

27. How to create VISTA style toolbar with CSS
Reproducing Vista toolbar, with buttons and hover effect in cross-browser compatible CSS and (X)HTML.

Vista CSS Toolbar

28. Fade Out Bottom
This is a demonstration of the effect where the bottom of the page seems to fade out. The technique makes use of an fixed position div (bottom: 0%) with a transparent PNG image and a high z-index value.

CSS-techniques - Fade Out Bottom

29. Scrollovers – A New Way of Linking
Everyone is familiar with hover-effects. This CSS+JavaScript-based techniques creates the Scrolleffect – not really necessary, but it’s nice to know, how it can be done.

Scrollovers

30. How to Style an A to Z Index with CSS

CSS-techniques - How to Style an A to Z Index with CSS | Smiley Cat Web Design

31. CSS List Boxes
Using a simple unordered list this experiment aligns the boxes across the page with the end result being to showcase items like services, products, or specials. One of cool thing about this — if you turn off styles — is the extractable semantics with the headings and paragraphs used.

List Boxes

32. How-to create a “Table of Contents” Navigation
In as little as 8 lines of HTML, and 5 lines of CSS, the Table Of Contents Navigation block can be integrated in your site ready for even more styling.

Table of Contents

33. CSS Recipe for Success

CSS-techniques - CSS - A Recipe for Success

34. Partial Opacity

CSS-techniques - Stu Nicholls | CSSplay | Partial Opacity

35. Simple Round CSS Links (Wii Buttons)

CSS-techniques - Simple Round CSS Links ( Wii Buttons )

36. How to make sexy buttons with CSS

CSS-techniques - How to make sexy buttons with CSS

37. CSS Pull Quotes

CSS-techniques - CSS Pull Quotes | Design Meme

38. Drop Shadow CSS

CSS-techniques - Drop Shadow CSS

39. CSS Speech Bubbles
Easy to customize speech bubbles coded in CSS and valid XHTML 1.0 strict.Tested in all major browsers.

Screenshot

40. CSS Double Lists

CSS-techniques - CSS: Double Lists | Mike’s Experiments | MikeCherim.com

41. Perspective Text with CSS

CSS-techniques - Mike’s Experiments: Archives Page | A Record of My Madness | Powered by the GreenBeast CMS RSS Newsmaker - -

42. Better Email Links: Featuring CSS Attribute Selectors
Learn how to generate code for displaying the e-mail automatically once mailto is used. CSS Attribute Selectors in action which is not supported by Internet Explorer 6 and 7.

Screenshot

43. CSS: Menu Descriptions
This is a CSS technique that could be useful if you want to give users accessible added content such as tool-tips, notifications, or alerts, without adding unnecessary clutter to your page. And since it doesn’t rely of JavaScript, it should be useful to everyone, even disabled users.

Screenshot

Further Techniques

44. CSS Transparency Settings for All Browsers

CSS-techniques - CSS Transparency Settings for All Browsers

45. Time Sensitive CSS Switcher
CSS Switching script that changes style sheet based on time of day.

46. Custom Reading Containers
This amazing little script allows the user to resize any container.

47. Eric Meyer’s CSS Reset

CSS-techniques - CSS Tools: Reset CSS

48. PNG Overlay
Create a transparent PNG overlay which can be used as a mask / frame around regular JPEG or GIF so users can upload photos without having to worry about using any graphics program to apply filters, plus it saves time.

49. Turning Lists into Trees

CSS-techniques - odyniec.net

50. Create Resizable Images With CSS

CSS-techniques - Create Resizable Images With CSS | Smiley Cat Web Design

↑ Back to top

Vitaly Friedman loves beautiful content and doesn’t like to give in easily. Vitaly is writer, speaker, author and editor-in-chief of Smashing Magazine. He runs responsive Web design workshops and loves solving complex problems in large companies. Get in touch.

  1. 1

    I got lost in this source!

    : )

    1
  2. 2

    Thanks for linking our article. You have some great collection of css techniques over here :)

    We have created 2 round-ups of CSS techniques that have some other great CSS Techniques that we can find handy.

    http://www.noupe.com/design/101-css-techniques-of-all-time-part-1.html
    http://www.noupe.com/css/101-css-techniques-of-all-time-part2.html

    0
  3. 3

    awesome collection, as always.

    tnx!

    0
  4. 4

    Great list. Another reason for me to procrastinate at work!!

    0
  5. 5

    I was just wondering why you keep reposting the same items in multiple articles.
    Sure, this one has many awesome new things, but many of them I’ve already seen before on your site.
    What’s going on?

    1
  6. 6

    nice list

    -1
  7. 7

    You guys are too awesome. I mean it! If it weren’t for you, I would still be a total newbie.

    Thanks! Keep it up, please.
    Thomas, 14 years

    0
  8. 8

    Thanks for the list – very useful – will keep me busy for a while!!!

    0
  9. 9

    Awesome! I know what I’m doing tonight.

    Thanks

    0
  10. 10

    I find all of your articles useful, but this particular article is the best I’ve seen yet. Thank you.

    0
  11. 11

    Nice!
    An excelent colection! Keep up the good work! =)

    0
  12. 12

    Great set of resources. Keep ‘em coming!

    0
  13. 13

    Holy smokin’ list o’ links! Guh! I’m rethinking various UI stuff now. Awesome collection!

    0
  14. 14

    Am I glad that I just inserted Smashingmagazine rss into my rss application! Very handy overview.

    0
  15. 15

    Nice list, I’m resolved to do my next big project with pngs! Smashmag kicks ass.

    0
  16. 16

    Vitaly Friedman & Sven Lennartz

    February 21, 2008 2:21 pm

    @Lisa: “I was just wondering why you keep reposting the same items in multiple articles.”

    We appreciate your concern, Lisa. However, it’s important to us that these useful resources are available to web-developers right away, so you don’t have to search through dozens of posts which cover not only CSS, but also other things. We try to do our best to make it as easy as possible to find these resources. This is what the whole thing is all about. This article is an example for exactly that.

    0
  17. 17

    Keep up the good work!!

    0
  18. 18

    Very useful post for techniques and inspiration.

    0
  19. 19

    I’ve been trying to figure out for awhile how Apple did their rounded form field on their homepage and got it to show up nicely in Safari 1.x

    I got my form fields hidden by hiding the border and making it white, but Safari 1.x still shows the ugly form field… anyone seen anything on this?

    0
  20. 20

    Reading this shows just how much there is to learn. Great list. New things to try.

    0
  21. 21

    I love you :)

    0
  22. 22

    Amazing List. Thanks.

    0
  23. 23

    You’ve duplicated a paragraph in the introduction.
    You’ve duplicated a paragraph in the introduction.

    Handy resource, I will try to refer to this article regularly.

    0
  24. 24

    wow, I have about 40 new side-projects :)

    0
  25. 25

    “Time Sensitive CSS Switcher”
    this is the stuff i’m looking for..now if they can change the whole content
    prior to within times..that’ll be even greater :D

    thanks for compiling the list for us css geek….

    0
  26. 26

    Oh my god, so may useful techniques. Thanks for collecting!!!

    0
  27. 27

    If u keep posting articles like this i can never call myself a CSS expert ;-)

    Thanks for great list ;-)

    0
  28. 28

    Best article ever.

    0
  29. 29

    My only thought after this post was that i love you :) Thanks for that!

    0
  30. 30

    Awesome list!

    This article goes far beyond any other I’ve seen

    Keep it up!

    0
  31. 31

    Excellent list as usual :) vote for dock icon from ndesign-studio, i use it on my website

    0
  32. 32

    An awesome collection of useful resources. Thank you!

    0
  33. 33

    Awesome!!

    0
  34. 34

    great! just added to my fav’s!!

    0
  35. 35

    Yet another incredibly inspiring list. Why would we expect anything less? Thanx

    0
  36. 36

    Great list.
    The title is in my opinion non appropriate. Most effects are combination of CSS AND Javascript.

    0
  37. 37

    CSS is the best!

    0
  38. 38

    what to say? SM is the best! great post. Where I’m I going to find time to explore most of the examples shown here? :)

    0
  39. 39
  40. 40

    Very useful tricks. Thanks

    0
  41. 41

    the best post ever :)

    0
  42. 42

    Superb!

    0
  43. 43

    Damn Good

    0
  44. 44

    This is quite a selection of techniques! And I must say, some are even new to me :)

    0
  45. 45

    Wow. So much to learn still. Great inspiration!!

    0
  46. 46

    Thanks for pointing out “Table of Contents” CSS example.

    Cheers

    0
  47. 47

    Hey thats neat..especially the Vista style CSS

    0
  48. 48

    Brilliant. Great list.

    0
  49. 49

    Awesome, very nicely done ‘smashing’

    0
  50. 50

    Venkadesan Tharshan

    February 22, 2008 6:30 am

    thanks.

    0
  51. 51

    13. Rediscovering the Button Element
    Love this tip; not many people are aware of the power that css has over buttons. Great article, thanks.

    0
  52. 52

    Nice collection, and thank you for including my article :)

    0
  53. 53

    This site is always a pleasure to look at… so much great stuff it is ridiculous. If my boss only knew how much time was spent on your site…

    0
  54. 54

    #1. Should’nt one image be enough? What is the reason for using three images?

    0
  55. 55

    Great list! One thing I wish to goodness I could find again is a CSS experiment site that used two different background images on the header so the right side was different from the left.

    The page was flexible and the right/left images were 100% of the horizontal viewport.

    Anyone know the technique I’m talking about or seen a similar site? The one I saw, just a few months ago, was for a mock beachwear/surf type company. I kick myself everyday for not bookmarking it!

    0
  56. 56

    @ donnie

    I too wondered that at first … why not just use one image? The reason is (I think) because you can tile each image separately and get a more random look. For instance the front image on a 1280×1024 screen tiles twice. The mid one tiles 1 and a little times. The back image tiles about three times. It just allows for more randomness without having to make a really large and long top image. All in all a pretty good idea.

    0
  57. 57

    @Fred Clown

    Yes I see it now. Different browser width generates different backgrounds. Did’nt see it earlier. =)

    0
  58. 58

    Oh Thank You, oh thank you. I needed this.

    CSS frustrates me to no end sometimes. I often wish I could trap and skin that damn fire fox. An inhumane leg hold trap at that. Other times I wish a hired gun would take out the entire IE development team, starting with the guy at the top. If i had my choice it would be the hit on MSN staffers before trapping that pesky fox. Definitely. Its far easier to tame the fox than it is to control that ignorant 800 pound gorilla.

    0
  59. 59

    useful content, thanks.

    0
  60. 60

    Tyler @ Building Camelot

    February 22, 2008 2:02 pm

    You guys always amaze me! This is an awesome article…thank you for taking the time to put this together.

    0
  61. 61

    I learned some neat tricks. Thanks!

    0
  62. 62

    nice article, useful links.. thanks ..

    0
  63. 63

    Thanks for including Clearleft‘s Silverback app faux-3D holding page – glad you like it! Though I’m slightly confused why you’d expect documentation to be included. How many websites include instructions on how they were made? Having said that, many people have asked for it and we will be publishing a short tutorial soon.

    0
  64. 64

    Great list for web developer .Thanks

    0
  65. 65

    Average Joe Helpers

    February 24, 2008 1:12 am

    This is actually something we have been looking for to further our website. We’ll have to implement some of this stuff, thanks :)

    0
  66. 66

    superb resource,love u gyies for this

    0
  67. 67

    Finally on 25th Feb 2008. I got a reason to say a Happy New Years!!! LOL Thank you Smashing Magazine!

    0
  68. 68

    David Jacques-Louis

    February 24, 2008 9:49 am

    Live it. Wow.

    0
  69. 69

    You guys rock!

    0
  70. 70

    To be honest, I expected CSS techniques in this article. Examples presented above show mostly various design techniques using CSS and Javascript. Therefore the article should have different heading… CSS techniques are for example CSS reset, hierarchical styling, using pseudoselectors, hacks and so on…

    0
  71. 71

    Great tips! Now I have to make my forms looking better… :)

    0
  72. 72

    Wow what a nice list, thanks

    0
  73. 73

    Here’s a tutorial on the faux-3D effect used on the Silverback holding page.
    http://www.thinkvitamin.com/features/design/how-to-recreate-silverbacks-parallax

    0
  74. 74

    Alfonso Marcos Vidal de la O

    February 28, 2008 2:41 am

    Great article! About PNG transparency AlphaImageLoader on “” elements we´ll find the solution on 49abcnews.com code: Using conditional comments + CSS like this:

    XHTML

    CSS
    “#element {
    background-image: none;
    filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=”http://media.49abcnews.com/img/trans-white-20.png”, sizingMethod=”scale”);
    }”

    0
  75. 75

    Alfonso Marcos Vidal de la O

    February 28, 2008 2:59 am

    Great article! About PNG transparency AlphaImageLoader on div, span, tables… elements, without a .js file, we´ll find the solution on 49abcnews.com code: Using conditional comments and CSS like this:

    CSS
    #element {
    background-image: none;
    filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=”http://media.49abcnews.com/img/trans-white-20.png”, sizingMethod=”scale”);
    }

    An example applying a shadow-effect over gradient background image:

    0
  76. 76

    Alfonso Marcos Vidal de la O

    February 28, 2008 3:01 am

    Great article! About PNG transparency AlphaImageLoader on div, span, tables… elements, without a .js file, we´ll find the solution on 49abcnews.com code: Using conditional comments and CSS like this:

    CSS
    #element {
    background-image: none;
    filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=”http://media.49abcnews.com/img/trans-white-20.png”, sizingMethod=”scale”);
    }

    0
  77. 77

    I came to smashing magazine originally for CSS and lately there have been a dearth of good CSS related posts, but this one filled that void. Awesome smashing post, keep em coming!

    0
  78. 78

    Thank you for your great job. There are much great ideas to discover….

    From Germany

    Ralph

    0
  79. 79

    haha I LOVE the favicon hyperlink cues. I’ve got to implement that. Excellent list as usual!

    0
  80. 80

    Nifty tool for css coders: markup generator. Saving you the time needed to write xhtml.

    0
  81. 81

    RE: #50. resizing images with text – one word – Opera

    bring on the browsers that support vector graphics.

    0
  82. 82

    wow. that’s all i can say. thanks!

    0
  83. 83

    Dennison Uy - Graphic Designer

    March 8, 2008 8:23 am

    Awesome list. Dugg!

    0
  84. 84

    Again, I hope I may point to a method that helps judging these techniques [1]. Some are in fact quite good, others might be “worth reconsideration”.

    [1] Great CSS Techniques

    0
  85. 85

    I love Tip 19. Iconize Textlinks with CSS – It’s so simple and yet effective

    Since this is my first comment on this page I want to congratulate you guys for this fantastic resource of inspiration.
    Many thanks
    Christian

    0
  86. 86

    I Like all the Css . These are all possible in GWT. I want to Apply These All css in GWT. I dont Know GHow to Apply .Please replay me any ones Nows.

    0
  87. 87

    I want to apply these CSS in GWT is it Possible?.. Any one Know Pls Reply.

    0
  88. 88

    We love that CSS sitemap. We use it all the time now to give our clients an easy-to-read prototype of their sitemap before actually building the site.

    We just built http://sitemappers.com/ to help us make these sitemaps (because we’re too lazy to keep typing out HTML).
    Go ahead and play with it

    0
  89. 89

    Great collection!

    0
  90. 90

    Simply superb !!! Such an inspiring collection of wonderful scripts and ides.. Kudos to all who worked behind this :-)

    0
  91. 91

    Nice collection, indeed! Thank you.

    0
  92. 92

    great tips really
    thx so much

    0
  93. 93

    hi:
    I want to know that how can i reduce using !important in margins for ie6.

    and

    How can i control the horizontal scrollbar of textarea of a form.

    thnkx

    0
  94. 94

    So great! thanks!

    0
  95. 95

    check out csspp

    0
  96. 96

    very informative site for me Thanks……!

    0
  97. 97

    great tips really
    thx so much
    .

    0
  98. 98

    BeantownDesign.com

    October 22, 2008 5:17 am

    Wow.. that’s a ton of good stuff. I like the one with the fade out in the bottom of the page. subtle but nice!

    0
  99. 99

    Great collection!

    0
  100. 100

    nice

    0
  101. 101

    wow..amazing..it;s great…thx

    0
  102. 102

    this is an very useful tips. thanks

    0
  103. 103

    I got lost in this source!

    0
  104. 104

    Excellent Tutorials my friends. Thank you for sharing. These are great time-saver effects! Keep up the good work!

    0
  105. 105

    Nice & greatfull resource… million of thanks

    0
  106. 106

    This is very useful to me. Thanks a lot!

    0
  107. 107

    I like css sites but more an more am getting bored with them.

    0
  108. 108

    Very helpful content fro any programmer , Web Designer and SEO.

    0
  109. 109

    great collections!

    thanks

    0
  110. 110

    great job . i hate from internet explorer 6 , i cant use PNG Transparency in my website.

    0
  111. 111

    very good, thnks so much.

    0
  112. 112

    duplicate files

    May 2, 2009 6:38 am

    very good, thnks so much.

    0
  113. 113

    Cre8ive Commando

    July 1, 2009 5:12 pm

    @Altyazı – It can be annoying to get transparent PNG images to work properly in ie6 but it is actually very easy to fix. Here is a very simple tutorial that will show you how to Fix transparent PNG images in ie6. It should only take a few minutes to set up on your website:

    0
  114. 114

    This is an awesome resource, but I feel that a bit too much of the stuff here is dependant on JavaScript to function, which is not really truth in advertisement for an article titled “Powerful CSS Techniques”.

    0
  115. 115

    its greats thks a lot..

    0
  116. 116

    another cool list from smashingmagazine

    (now i just need a clone of myself that can spend all day absorbing this endless supply of useful information)

    0
  117. 117

    it 2good

    0
  118. 118

    Shrikrishna Meena

    November 5, 2010 12:13 am

    Few of them are really awesome… Thanks for introducing them with us.

    0
  119. 119

    Dwight Zahringer

    March 25, 2011 8:12 am

    Wow, great list. Spent about 1/2 hour here. Thanks for compiling.

    0

↑ Back to top