CSS3 Transitions

With CSS3, we can add an effect when changing from one style to another, without using Flash animations or JavaScripts.
CSS3 transitions are effects that let an element gradually change from one style to another.

Shorthand:
transition: property_name duration timing_function delay;

To do this, you must specify two things:

  • Specify the CSS property you want to add an effect to
  • Specify the duration of the effect

Transition effect on the width property, duration: 2 seconds:

.moduleDefault {
transition: width 2s;
-moz-transition: width 2s; /* Firefox 4 and above */
-webkit-transition: width 2s; /* Safari and Chrome */
-o-transition: width 2s; /* Opera */
}

Note: If the duration is not specified, the transition will have no effect, because default value is 0.

The effect will start when the specified CSS property changes value. A typical CSS property change would be when a user mouse-over an element:

.moduleDefault:hover {
width: 300px;
}

Multiple changes:
You can also add a transitional effect for more than one style, add more properties, separated by commas.

Add effects on the width, height, and the transformation:

div
{
transition: width 2s, height 2s, transform 2s;
-moz-transition: width 2s, height 2s, -moz-transform 2s;
-webkit-transition: width 2s, height 2s, -webkit-transform 2s;
-o-transition: width 2s, height 2s,-o-transform 2s;
}

Note: These properties are not supported in IE

HTML5 Reset Stylesheet

html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
abbr, address, cite, code,
del, dfn, em, img, ins, kbd, q, samp,
small, strong, sub, sup, var,
b, i,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, figcaption, figure,
footer, header, hgroup, menu, nav, section, summary,
time, mark, audio, video {
margin:0;
padding:0;
border:0;
outline:0;
font-size:100%;
vertical-align:baseline;
background:transparent;
}

body {
line-height:1;
}

article,aside,details,figcaption,figure,
footer,header,hgroup,menu,nav,section {
display:block;
}

nav ul {
list-style:none;
}

blockquote, q {
quotes:none;
}

blockquote:before, blockquote:after,
q:before, q:after {
content:”;
content:none;
}

a {
margin:0;
padding:0;
font-size:100%;
vertical-align:baseline;
background:transparent;
}

/* change colours to suit your needs */
ins {
background-color:#ff9;
color:#000;
text-decoration:none;
}

/* change colours to suit your needs */
mark {
background-color:#ff9;
color:#000;
font-style:italic;
font-weight:bold;
}

del {
text-decoration: line-through;
}

abbr[title], dfn[title] {
border-bottom:1px dotted;
cursor:help;
}

table {
border-collapse:collapse;
border-spacing:0;
}

/* change border colour to suit your needs */
hr {
display:block;
height:1px;
border:0;
border-top:1px solid #cccccc;
margin:1em 0;
padding:0;
}

input, select {
vertical-align:middle;
}

Reference: http://code.google.com/p/html5resetcss/downloads/list

Best CSS Directories or Galleries

www.cssbeauty.com
www.cssdrive.com
www.stylegala.com
www.cssmania.com
www.cssremix.com
www.cssvault.com
www.bestwebgallery.com
www.csselite.com
www.screenalicious.com
www.unmatchedstyle.com
www.designlinkdatabase.net
www.screenfluent.com
www.designsnack.com
www.cssheaven.com
www.cssimport.com
www.cssglobe.com
www.cssreboot.com
www.mostinspired.com
www.thebestdesigns.com
www.cssbloom.com
www.csscollection.com
www.csstux.com
www.cssbased.com
www.css-website.com
www.designshack.co.uk
www.ceeses.com
www.cssclip.com
www.my3w.org
www.csshazard.com
www.artnetz.de
www.css-design-yorkshire.com
www.css11.com
www.cssimpress.com
www.e-motionaldesign.com
www.cssprincess.com
www.cssgaleri.com
www.cssblast.ru
www.creative-pakistan.com
www.netzfruehling.de
www.najdizajn.com
www.edustyle.net
www.csssmoothoperator.com
www.coolsitecollection.com
www.cssgalaxy.com
www.per.fectio.net
www.cssflavor.com
www.onepixelarmy.com
www.piepmatzel.de
www.cssbrain.hu
www.w3c-compliance.com
www.stylegrind.com
www.submitcss.com
www.cssgallery.ro
www.cssgreen.com
www.csszengarden.com
www.webcreme.com
www.prowebart.net
www.designexpanse.com
www.csssnap.com
www.menthe-fresh.fr
www.csscoosite.com
www.csscool.cn
www.csstown.com
www.cssleak.com
www.divinecss.com
www.cssloggia.com
www.cssstyle.me
www.cssperk.com
www.cssgallery.com
www.cssshowcases.com
www.cssglance.com
www.cssmix.nl
www.css-design.fr
www.designawardsgallery.com
www.addesignlink.com
www.cssfreshblend.com
www.cssenvy.com
www.nicestylesheet.com
www.wowcss.com
www.css-imagine.com
www.cssfights.com
www.cssluxury.com
www.cssdepot.com
www.csswebsites.nl
www.cssarts.com
www.csscutie.com
www.cssdance.com
www.csskid.com
www.cssbay.com
www.wooki.es
www.beautiful2.com
www.swellcss.com
www.noonewebdesign.com
www.cssvote.com
www.pixelcss.es

You can also submit your site to 150+ CSS Directories to showcase. Here are the two sites who does this job for you.
1. Easy CSS Gallery Listhttp://www.thecssgallerylist.com
2. CSS Galleries Submission Helperhttp://www.meecss.com

CSS Tooltips

No need of javascript to make tooltips. I got this simple css trick to make it.

CSS Code

a:hover {
background:#ffffff; /*BG color is a must for IE6*/
text-decoration:none;
}

a.mytooltip span {
display:none;
padding:2px 3px;
margin-left:8px;
width:200px;
}

a.mytooltip:hover span{
display:inline;
position:absolute;
background:#ffffff;
border:1px solid #cccccc;
color:#6c6c6c;
}

HTML Code

<a href=”#” class=”mytooltip”>Vikas Khera<span>https://vikaskhera.wordpress.com</span></a&gt;

CSS Tips & Tricks

Here is a list of CSS tips & tricks that will make your coding so much easier.

Sequence of the links is very important

a:link { color: #000; text-decoration: none; }
a:visited { color: #666; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
a:active { color: #333; text-decoration: underline; }

Use future proof CSS hacks method
<!–[If IE 5]>
ie 5
<![endif]– >

<!–[If lte 6] >
ie 6 and lower
<![endif]–>

<!–[If gte 7] >
ie 7 or higher
<![endif]– >

Use group selector
h1, h2, h3, h4, h5, h6 {
font-family:verdana;
margin:0;
padding:0;
}

Cross Browser CSS Transparency Setting
.transparent_class {
filter:alpha(opacity=50); /* ie */
-moz-opacity:0.5; /* old mozilla browser like netscape */
-khtml-opacity: 0.5; /* for really really old safari */
opacity: 0.5; /* css standard, currently it works in most modern browsers like firefox, */
}

PNG Fix for IE6
.png_ie_hack {
background-image: url(../images/pngimage.png) !important;
background-image: none;
filter: none !important;
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=’../images/pngimage.png’);
}

Remove links or textbox hightlight border
a, input { outline:none; }

Hidden text for search engine
a { text-indent:-999em; outline:none; background: url(image.jpg) no-repeat 0 0; width:100px; height:50px; display:block; }

Click here for more details on CSS Optimization.

Optimize your stylesheet

If your website uses large stylesheets, optimizing the CSS code can help your code to load and render faster. CSS shortcuts shortern the cascading stylesheets rules into one efficient line of code.

Fonts

.MyClass
{
font-weight: normal;
font-size: 14px;
line-height: 12px;
font-family: arial, verdana;
}

You can simply use:

.MyClass
{
font: normal 14px/12px arial, verdana;
}

Background Images

#MyID
{
background-image:url(images/Vikas.gif);
background-position:top;
background-repeat:repeat-x;
background-color:#r1f1f1;
}

Can be shortened to:

#MyID
{
background: #f1f1f1 url(images/Vikas.gif) repeat-x top;
}

Borders

.MyClass
{
border-width: 1px;
border-color: #e0e0e0;
border-style: solid;
}

Shortcut:
.MyClass
{
border: 1px solid #e0e0e0;
}

Margins/Padding

#MyID
{
padding-top: 10px;
padding-right: 5px;
padding-bottom: 20px;
padding-left: 5px;
}

Use a single line of code, like this:

padding: top right bottom left;

#MyID
{
padding: 10px 5px 20px 5px;
}

The margin or padding shortcut can be be shortened further.

margin: top right bottom left;
margin: 10px 20px 10px 20px;

Can be shortened to:

margin: top/bottom right/left;
margin:10px 20px;

You can even take this one step further.

margin: top/bottom/right/left;
margin:10px;

If you do not want any margins or padding with a web object, you can set all of the values to zero.

margin: 0;
padding: 0;

Color

color: #000000;

shortcut:
color: #000

color: #FFCC00;

shortcut:
color: #FC0;