• CSS3 Zebra Striping a Table

    tbody tr:nth-child(odd) {
       background-color: #ccc;
    }
    
  • Cross-Browser hr Styling

    hr {
           border : 0;
           height : 15px;
           background : url(hr.gif) 50% 0 no-repeat;
           margin : 1em 0;
    }
    
  • Give Clickable Elements a Pointer Cursor

    a[href], input[type='submit'], input[type='image'], label[for], select, button, .pointer {
           cursor: pointer;
    }
    
  • Not-Terrible Image Resizing in IE

    img {
           -ms-interpolation-mode: bicubic;
    }
    
  • Fixed Footer

    footer {
       position:fixed;
       left:0px;
       bottom:0px;
       height:30px;
       width:100%;
       background:#999;
    }
    
    /* IE 6 */
    * html #footer {
       position:absolute;
       top:expression((0-(footer.offsetHeight)+(document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight)+(ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop))+'px');
    }
    
  • Internationalization Language CSS

    /*Language-specific*/
    :lang(af){quotes:'\201E' '\201D' '\201A' '\2019';}
    :lang(ak){font-family:Lucida,"DejaVu Sans",inherit;}
    :lang(ar){font-family:Tahoma 12,Nazli,KacstOne,"DejaVu Sans",inherit;}
    :lang(bg){quotes:'\201E' '\201C' '\201A' '\2018';}
    :lang(bn){font-family:FreeSans,MuktiNarrow,Vrinda,inherit;font-size:1.1em;line-height:1.4em;}
    :lang(cs){quotes:'\201E' '\201C' '\201A' '\2018';}
    :lang(da){quotes:'\00BB' '\00AB' '\203A' '\2039';}
    :lang(de){quotes:'\201E' '\201C' '\201A' '\2018';}
    :lang(el){font-family:"DejaVu Sans",inherit;quotes:'\00AB' '\00BB' '\2039' '\203A';}
    :lang(en-GB){quotes:'\2018' '\2019' '\201C' '\201D';}
    :lang(es){quotes:'\00AB' '\00BB' '\2039' '\203A';}
    :lang(fa){font-family:Terafik,Traffic,Roya,Nazli,Nazanin,sans;font-size:1.5em;}
    :lang(fi){quotes:'\201D' '\201D' '\2019' '\2019';}
    :lang(fr){quotes:'\ab\2005' '\2005\bb' '\2039\2005' '\2005\203a';}
    :lang(hr){quotes:'\00BB' '\00AB' '\203A' '\2039';}
    :lang(is){quotes:'\201E' '\201C' '\201A' '\2018';}
    :lang(ja){font-size:1.1em;}
    :lang(km){font-family:"Khmer OS System","Khmer OS","Khmer Kampongtrach","CDT Khmer",inherit;line-height:2em;}
    :lang(ko){font-size:1.1em;}
    :lang(lt){quotes:'\201E' '\201C' '\201A' '\2018';}
    :lang(nl){quotes:'\201E' '\201D' '\201A' '\2019';}
    :lang(pl){quotes:'\201E' '\201D' '\201A' '\2019';}
    :lang(ro){quotes:'\201E' '\201C' '\201A' '\2018';}
    :lang(sk){quotes:'\201E' '\201C' '\201A' '\2018';}
    :lang(sq){quotes:'\00AB' '\00BB' '\2039' '\203A';}
    :lang(sr){quotes:'\201E' '\201C' '\201A' '\2018';}
    :lang(sv){quotes:'\201D' '\201D' '\2019' '\2019';}
    :lang(tr){quotes:'\00AB' '\00BB' '\2039' '\203A';}
    :lang(vi){font-family:"Lucida Grande","Vu Phu Tho","DejaVu Sans",inherit;}
           :lang(vi) a:hover,:lang(vi) a:active{text-decoration:none;color:#606047;}
    :lang(zh){font-size:1.5em;}
    
  • Print URL After Links

    @media print{
           a:after{content:" (" attr(href) ") ";font-size:0.8em;font-weight:normal;}
    }
    
  • Strict DOCTYPE

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    
  • Sidebar Definition

    if ( function_exists('register_sidebar') ) { register_sidebar(array( 'name'=>'Footer Widgets',

  • 301 Redirects

    Redirect 301 /oldpage.html http://www.yoursite.com/newpage.html
    Redirect 301 /oldpage2.html http://www.yoursite.com/folder/
    
  • Custom Error Pages

    ErrorDocument 400 /errors/badrequest.html
    ErrorDocument 401 /errors/authreqd.html
    ErrorDocument 403 /errors/forbid.html
    ErrorDocument 404 /errors/notfound.html
    ErrorDocument 500 /errors/serverr.html
    
  • Force Files to Download (Not Open in Browser)

    AddType application/octet-stream .csv
    AddType application/octet-stream .xls
    AddType application/octet-stream .doc
    AddType application/octet-stream .avi
    AddType application/octet-stream .mpg
    AddType application/octet-stream .mov
    AddType application/octet-stream .pdf
    
  • Prevent Image Hotlinking

    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^http://(.+\.)?yourdomain\.com/ [NC]
    RewriteCond %{HTTP_REFERER} !^$
    RewriteRule .*\.(jpg|gif|bmp|png)$ /images/dontsteal.jpg [L]
    
    
  • Force WWW

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^your-site.com [NC]
    RewriteRule ^(.*)$ http://www.your-site.com/$1 [L,R=301]
    
  • No WWW

    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^your-site.com$ [NC]
    RewriteRule ^(.*)$ http://your-site.com/$1 [L,R=301]