Recent News

Counting in CSS

One of the best things you can do as a Rails developer is remember to utilize everything at your disposal. Last week, I had this front-end task to set up dynamic footnotes; I initially assumed I would be doing this in Ruby, until i found this choice CSS2 “counter” support:

body { counter-reset: footnote; }
.footnote:before {
  content: counter(footnote);    
  counter-increment: footnote 1;  
}

No kidding! It’s a good reminder—CSS is quite evolved and mature, and it contains a lot of little-discussed functionality. Remember to exploit it as much as possible (IE6 notwithstanding)…



Comments are closed

cementhorses.com

Categories

Cement Horses Pics

Archives