CSS3 Tricks

# Animated Hovers

## First Hover

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris fermentum dictum magna. Sed laoreet aliquam leo.

Button

## Second Hover

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris fermentum dictum magna. Sed laoreet aliquam leo.

Button

## Third Hover

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris fermentum dictum magna. Sed laoreet aliquam leo.

Button

## Fourth Hover

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris fermentum dictum magna. Sed laoreet aliquam leo.

Button

## Fifth Hover

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris fermentum dictum magna. Sed laoreet aliquam leo.

Button

## Sixth Hover

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris fermentum dictum magna. Sed laoreet aliquam leo.

Button

## Seventh Hover

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris fermentum dictum magna. Sed laoreet aliquam leo.

Button

## Eighth Hover

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris fermentum dictum magna. Sed laoreet aliquam leo.

Button

The structure of markup is very simple and intuitive. Create a container that will have our image and all the other infomation.

    <div class="tm_view tm_view_first">
    	<img src="YourImage.jpg" alt="" />
    	<div class="tm_mask">
    		<h2> Heading </h2>
    		<p> Text </p>
    		<a href="" class="btn">Button</a>
    	</div>
    </div>

Add the special class tm_view_first to the element with the class tm_view for the first effect.

In the second hover we will add the special class tm_view-second, but we will leave the element with the class tm_mask empty and wrap the description in a div with the class content

    <div class="tm_view tm_view_second">
    	<img src="YourImage.jpg" alt="" />
    	<div class="tm_mask"></div>
    	<div class="tm_content">
    		<h2> Heading </h2>
    		<p> Text </p>
    		<a href="" class="btn">Button</a>
    	</div>
    </div>

For other hover effects you can use the same HTML structure. You only need to change class tm_view_second to the following ones:
tm_view_third - third effect
tm_view_fourth - fourth effect
tm_view_fifth - fifth effect
tm_view_sixth - sixth effect
tm_view_seventh - seventh effect
tm_view_eight - eight effect

In ninth hover, we will use two tm_mask elements to slide them in from the bottom right and the top left:

    <div class="tm_view tm_view_ninth">
    	<img src="YourImage.jpg" alt="" />
    	<div class="tm_mask tm_mask-1"></div>
    	<div class="tm_mask tm_mask-2"></div>
    	<div class="tm_content">
    		<h2> Heading </h2>
    		<p> Text </p>
    		<a href="" class="btn">Button</a>
    	</div>
    </div>

Define .tm_view and .tm_mask width and height which match image`s width and height in style.css file.

CSS3 has a really great potential for creating nice effects. Soon, we’ll hopefully be able to avoid the use of JavaScript for simple effects and rely 100% on CSS, in all browsers.

# Animated Buttons

Add necessary class to the <a> tag (<a href="" class=""> Button Text </a>)

Click me!

    class="btn tm_style_1"

Click me!

    class="btn btn-warning tm_style_1"

Click me!

    class="btn btn-success tm_style_1"

Click me!

    class="btn btn-danger tm_style_1"

Any button may be longer

    class="btn btn-info tm_style_1"

Click me!

    class="btn tm_style_2"

Click me!

    class="btn btn-warning tm_style_2"

Any button may be longer

    class="btn btn-success tm_style_2"

Click me!

    class="btn btn-danger tm_style_2"

Click me!

    class="btn btn-info tm_style_2"

Click me!

    class="btn tm_style_3"

Click!

    class="btn btn-warning tm_style_3"

Click!

    class="btn btn-success tm_style_3"

Click!

    class="btn btn-danger tm_style_3"

Click!

    class="btn btn-info tm_style_3"

Click me!

    class="btn tm_style_4"

Click me!

    class="btn btn-warning tm_style_4"

Click me!

    class="btn btn-success tm_style_4"

Click me!

    class="btn btn-danger tm_style_4"

Click me!

    class="btn btn-info tm_style_4"

# CSS3 Images Style

When applying CSS3 inset box-shadow or border-radius directly to the image element, the browser doesn't render the CSS style perfectly. However, if the image is applied as background-image, you can add any style to it and have it rendered properly.

To add such images to the page you need to copy the code and in the style.css file define background image and image dimensions.

###### Circle Image

    <span class="tm_image_round"></span>

###### Card Style

    <span class="tm_image_card"></span>

###### Embossed Style

    <span class="tm_image_embossed"></span>

###### Soft Embossed Style

    <span class="tm_image_soft-embossed"></span>

###### Cutout Style

    <span class="tm_image_cut_out"></span>

###### Morphing & Glowing

    <span class="tm_image_morphing_glowing"></span>

###### Glossy Overlay

    <span class="tm_image_glossy"></span>

###### Reflection

    <span class="tm_image_reflection"></span>

###### CSS

    .YourStyle{
    background:url(YourImage.jpg) 0 0 no-repeat;
    width:YourImageWidth px;
    height:YourImageHeight px;
    }

# Shadows on CSS3

Lifted Shadow

    <div class="tm_lifted">
     <div class="tm_text-shadow"> Text </div>
    </div>

Perspective Shadow

    <div class="tm_perspective">
     <div class="tm_text-shadow"> Text </div>
    </div>

Raised Block

    <div class="tm_raised">
     <div class="tm_text-shadow"> Text </div>
    </div>

Shadow with two vertical curves

    <div class="tm_curved-vt-2">
     <div class="tm_text-shadow"> Text </div>
    </div>

Shadow with two horizontal curves

    <div class="tm_curved-hz-2">
     <div class="tm_text-shadow"> Text </div>
    </div>