Posted by Nick Wallace | Posted in Code | Posted on 08-09-2010-05-2008
0
As a developer I tend to cringe when I think of CSS. While it is a great way to style up a page, the language itself is cumbersome and confusing.
Enter Compass! This Ruby Gem is VERY sweet at making CSS an easy to work with language. It uses the SASS language for building the stylesheet and then compiles into a CSS file minimized.
Watch the intro below and check out more at their website.
Posted by Nick Wallace | Posted in Code | Posted on 07-09-2010-05-2008
0
So you want to zebra stripe your table tr’s or your li’s? You dont want another jquery plugin bogging down your system and you dont want a bajillion lines of code to get this thing striped right.
Here it goes:
For a table with <tr> tags simply do the following:
Let’s say I have a table and inside that table are a bunch of TR’s which are more than likely in a foreach loop of some sort. Let’s give the TR a class of striped-table
<tr class="striped-table">
Now in the document ready just add in the following:
This will choose the odd TR’s and give it a background color of #CCC. The nextUntil function goes through all of the children inside of the current TR and gives them a background color of #CCC, so this means all of the TD’s inside of the TR.
The same thing will work for UL/LI’s. Just make sure the UL has the class striped-ul