Translate

Sunday, 26 May 2013

Row styling using CSS3

                        


index.php:

    <div id="container">
    <h2>Alternate row styling using CSS3</h2>
    <h3>Even</h3>
    <ul class="even">
    <li>Creatersite is my Blog</li>
    <li>Creatersite is my Blog</li>
    <li>Creatersite is my Blog</li>
    <li>Creatersite is my Blog</li>
    </ul>
    <h3>Odd</h3>
    <ul class="odd">
    <li>Creatersite is my Blog</li>
    <li>Creatersite is my Blog</li>
    <li>Creatersite is my Blog</li>
    <li>Creatersite is my Blog</li>
    </ul>
    </div> 

style.css:




    body{ background-color:#666;margin:2% auto;color:#FFF; padding:10px;}
    #container{width: 960px; margin: 50px auto;}
    h3{ padding:10px;} h3,h2{ color:#800000;}
    ul li { padding:3px;}
    ul.even li:nth-child(even){ color:#CC0;}
    ul.odd li:nth-child(odd ) { color:#FF8000;}

3 comments:

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. I thing :even and :odd will do more semantic(ism) here

    F1beta.com

    ReplyDelete