10 Cool CSS Image Effects


This Article outlines 10 excellent image effects for your website that can all be easily achieved using just plain old HTML and CSS. The image above shows just 3 of the effects that can be created, others included the Polaroid image effect, creating circular or elliptical images and even stacking multiple image on top of each other. The effects are listed in order of difficulty (in my opinion), so perhaps start with the first one and progress from there.



Image Rotation:




The HTML



The CSS

div.rotate  
{
-ms-transform: rotate(7deg); /* IE 9 */
-webkit-transform: rotate(7deg); /* Chrome, Safari, Opera */
transform: rotate(7deg);
}


Border With Drop Shadow:





The HTML



The CSS

div.shadow 
{
-moz-box-shadow: 10px 10px 5px #888888;
-webkit-box-shadow: 10px 10px 5px #888888;
box-shadow: 10px 10px 5px #888888;
border:15px solid #ffffcc;
}


Layered / Stacked Images:



The HTML



The CSS

div.box1
{
z-index:1;
position:relative;
-webkit-transform: rotate(-3deg);
-ms-transform: rotate(-3deg);
-o-transform: rotate(-3deg);
transform: rotate(-3deg);
}

div.box2
{
z-index:2;
position:relative;
left:-150px;
}

div.box3
{
z-index:3;
position:relative;
left:-350px;
-webkit-transform: rotate(3deg);
-ms-transform: rotate(3deg);
-o-transform: rotate(3deg);
transform: rotate(3deg);
}

Circular Images Effect:



In the examples above the image is 200px high and wide with a border-radius of 100px. The key to creating circles is for the border radius to be half of the height and width.

CSS

img{border-radius:100px; height:200px; width:200px;}


Elliptical Images Effect:



In the examples above each box is 200px high and 300px wide with a border-radius of 50%. The key to creating ellipses is for the border radius to be 50%.

CSS

img{border-radius:50%; height:200px; width:300px;}


Polaroid Image Effect:


Waterfall Photo

The HTML



The CSS

.polaroid 
{
position: relative; text-align: center;
}

.polaroid img
{
border: 10px solid #fff;
border-bottom: 45px solid #fff;
-webkit-box-shadow: 0px 0px 10px #777;
-moz-box-shadow: 0px 0px 10px #777;
box-shadow: 0px 0px 10px #777;
-webkit-transform: rotate (3deg);
-moz-transform: rotate (3deg);
transform: rotate (3deg);
}

.polaroid p
{
position: absolute;
text-align: center;
width: 100%;
bottom: 0px;
font: 400 18px/1 'Kaushan Script', cursive;
color: #888;
z-index:99; }



Description On Hover:




⇧ Description

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse vel commodo turpis. Cras et congue justo. Nullam rhoncus commodo tellus, eget fringilla lacus pellentesque et.


The HTML



The CSS

.image
{
overflow:hidden;
width:auto;
height:240px; /*should match your images height*/
}

.image-desc
{
text-align:justify;
position:relative;
top:-40px; /*allows the first part of the description to be visible*/
overflow: hidden;
font-size:14px;
padding:10px;
height: 200px;
color: #ffffff;
background-color: #000066;
opacity: 0.8;}

.image-desc:hover
{
position: relative;
top:-187px;
opacity: 0.8;
}


Map Pin Effect:


The HTML



The CSS

div.rotate  
{
.pin
{
z-index:2;
position:relative;
top:18px;
left:0px;
}

.photo
{
z-index:1;
position:relative;
}

}


Paper Clip Effect:

The HTML



The CSS

 
{
.paper-clip
{
z-index:2;
position:relative;
top:18px;
left:5px;
}

.photo
{
z-index:1;
position:relative;
}

}

Masking Tape Effect:


The HTML



The CSS

 
{
.tape
{
z-index:2;
position:relative;
top:18px;
left:5px;
}

.photo
{
z-index:1;
position:relative;
}

}

CSS3 Media Queries For A Responsive Website Template

Common device breakpoints


At this point you have probably already heard about responsive web design and how every website needs to compatible to work well and look good across multiple devices. If so, you heard right!

With a @media query, you can write different CSS code for different screen sizes or for different devices, which is very useful when making web pages with responsive design. You can also have different layout when a user resizes a browser window up or down to a certain width, or height.

Responsive web design is vital for any web project and CSS media queries are vital for a successful responsive website. So to make things a little easier for you here are all the main CSS media queries need for a responsive website.


CSS Media Queries For a Responsive Website


/*Responsive Styles*/


/* Smartphones (portrait) ---------------- */
@media only screen
and (max-width : 320px)
{
/* Add Your CSS Styling Here */
}

/* Smartphones (landscape) ---------------- */
@media only screen
and (min-width : 321px)
and (max-width : 767px)
{
/* Add Your CSS Styling Here */
}

/* Tablets (portrait) -------------------- */
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px)
and (orientation : portrait)
{
/* Add Your CSS Styling Here */
}


/* Tablets (landscape) ------------------- */
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px)
and (orientation : landscape)
{
/* Add Your CSS Styling Here */
}

/* Old Desktops and laptops ------------------ */
@media only screen
and (min-width : 1025px)
{
/* Add Your CSS Styling Here */
}

/* Desktops ------------------ */
@media only screen
and (min-width : 1201px)
{
/* Add Your CSS Styling Here */
}



By inserting the relevant CSS code in each section you can have elements of your web page responding to the screen size or device orientation of your user.

More web tips,templates and tutorials coming soon as part of our "month of web" at OnlineDesignTeacher. Follow us on Twitter and Facebook to be sure you don't miss out.

3 Uses For CSS3 Border-Radius

As part of the month of web at OnlineDesignTeacher we are going to look at 3 good uses for the CSS border-radius tag. First off the obvious one....

Border-Radius For Rounded Edges

In the examples above each box is 200px high and wide. The first box has a border-radius of 10px, the second has 15px and the third 20px.

#box1{background:#660000; border-radius:5px; height:100px; width:100px}

#box2{background:#660000; border-radius:5px; height:100px; width:100px}

#box2{background:#660000; border-radius:5px; height:100px; width:100px}

So that's the basic one, now for the more interesting effects...


Border-Radius Creates Circles



In the examples above each box is 200px high and wide with a border-radius of 100px. The key to creating circles is for the border radius to be half of the height and width.

#box1{background:#660000; border-radius:100px;height:200px; width:200px;}

img{border-radius:100px; height:200px; width:200px;}



Border-Radius Creates Ellipses



In the examples above each box is 200px high and 300px wide with a border-radius of 50%. The key to creating ellipses is for the border radius to be 50%.

img{border-radius:50%; height:200px; width:300px;}



More web tips,templates and tutorials coming soon as part of our "month of web" at OnlineDesignTeacher. Follow us on Twitter and Facebook to be sure you don't miss out.

HTML Symbol Codes


A Selection Of Some HTML Symbols

Below is an extensive list of the character codes for use in your HTML. Some characters are reserved in HTML. Reserved characters in HTML must be replaced with character entities, for example if you use the less than (<) or greater than (>) signs in your text, the browser might mix them with tags. Character entities are used to display reserved characters in HTML. Characters, not present on your keyboard, can also be replaced by entities.

Find the symbol or charcter code you need in the table below




Description
Entity Name
Hex Code
Symbol
Latin small f with hook = function
&fnof;
&#x192;
ƒ
Greek capital letter alpha
&Alpha;
&#x391;
Α
Greek capital letter beta
&Beta;
&#x392;
Β
Greek capital letter gamma
&Gamma;
&#x393;
Γ
Greek capital letter delta
&Delta;
&#x394;
Δ
Greek capital letter epsilon
&Epsilon;
&#x395;
Ε
Greek capital letter zeta
&Zeta;
&#x396;
Ζ
Greek capital letter eta
&Eta;
&#x397;
Η
Greek capital letter theta
&Theta;
&#x398;
Θ
Greek capital letter iota
&Iota;
&#x399;
Ι
Greek capital letter kappa
&Kappa;
&#x39A;
Κ
Greek capital letter lambda
&Lambda;
&#x39B;
Λ
Greek capital letter mu
&Mu;
&#x39C;
Μ
Greek capital letter nu
&Nu;
&#x39D;
Ν
Greek capital letter xi
&Xi;
&#x39E;
Ξ
Greek capital letter omicron
&Omicron;
&#x39F;
Ο
Greek capital letter pi
&Pi;
&#x3A0;
Π
Greek capital letter rho
&Rho;
&#x3A1;
Ρ
Greek capital letter sigma
&Sigma;
&#x3A3;
Σ
Greek capital letter tau
&Tau;
&#x3A4;
Τ
Greek capital letter upsilon
&Upsilon;
&#x3A5;
Υ
Greek capital letter phi
&Phi;
&#x3A6;
Φ
Greek capital letter chi
&Chi;
&#x3A7;
Χ
Greek capital letter psi
&Psi;
&#x3A8;
Ψ
Greek capital letter omega
&Omega;
&#x3A9;
Ω
Greek small letter alpha
&alpha;
&#x3B1;
α
Greek small letter beta
&beta;
&#x3B2;
β
Greek small letter gamma
&gamma;
&#x3B3;
γ
Greek small letter delta
&delta;
&#x3B4;
δ
Greek small letter epsilon
&epsilon;
&#x3B5;
ε
Greek small letter zeta
&zeta;
&#x3B6;
ζ
Greek small letter eta
&eta;
&#x3B7;
η
Greek small letter theta
&theta;
&#x3B8;
θ
Greek small letter iota
&iota;
&#x3B9;
ι
Greek small letter kappa
&kappa;
&#x3BA;
κ
Greek small letter lambda
&lambda;
&#x3BB;
λ
Greek small letter mu
&mu;
&#x3BC;
μ
Greek small letter nu
&nu;
&#x3BD;
ν
Greek small letter xi
&xi;
&#x3BE;
ξ
Greek small letter omicron
&omicron;
&#x3BF;
ο
Greek small letter pi
&pi;
&#x3C0;
π
Greek small letter rho
&rho;
&#x3C1;
ρ
Greek small letter final sigma
&sigmaf;
&#x3C2;
ς
Greek small letter sigma
&sigma;
&#x3C3;
σ
Greek small letter tau
&tau;
&#x3C4;
τ
Greek small letter upsilon
&upsilon;
&#x3C5;
υ
Greek small letter phi
&phi;
&#x3C6;
φ
Greek small letter chi
&chi;
&#x3C7;
χ
Greek small letter psi
&psi;
&#x3C8;
ψ
Greek small letter omega
&omega;
&#x3C9;
ω
Greek small letter theta symbol
&thetasym;
&#x3D1;
ϑ
Greek upsilon with hook symbol
&upsih;
&#x3D2;
ϒ
Greek pi symbol
&piv;
&#x3D6;
ϖ
bullet = black small circle
&bull;
&#x2022;
horizontal ellipsis = three dot leader
&hellip;
&#x2026;
prime = minutes = feet
&prime;
&#x2032;
double prime = seconds = inches
&Prime;
&#x2033;
overline = spacing overscore
&oline;
&#x203E;
fraction slash
&frasl;
&#x2044;
blackletter capital I = imaginary part
&image;
&#x2111;
blackletter capital R = real part symbol
&real;
&#x211C;
trade mark sign
&trade;
&#x2122;
alef symbol = first transfinite cardinal
&alefsym;
&#x2135;
leftwards arrow
&larr;
&#x2190;
upwards arrow
&uarr;
&#x2191;
rightwards arrow
&rarr;
&#x2192;
downwards arrow
&darr;
&#x2193;
left right arrow
&harr;
&#x2194;
downwards arrow with corner leftwards = carriage return
&crarr;
&#x21B5;
leftwards double arrow
&lArr;
&#x21D0;
upwards double arrow
&uArr;
&#x21D1;
rightwards double arrow
&rArr;
&#x21D2;
downwards double arrow
&dArr;
&#x21D3;
left right double arrow
&hArr;
&#x21D4;
for all
&forall;
&#x2200;
partial differential
&part;
&#x2202;
there exists
&exist;
&#x2203;
empty set = null set = diameter
&empty;
&#x2205;
nabla = backward difference
&nabla;
&#x2207;
element of
&isin;
&#x2208;
not an element of
&notin;
&#x2209;
contains as member
&ni;
&#x220B;
n-ary product = product sign
&prod;
&#x220F;
n-ary sumation
&sum;
&#x2211;
minus sign
&minus;
&#x2212;
asterisk operator
&lowast;
&#x2217;
square root = radical sign
&radic;
&#x221A;
proportional to
&prop;
&#x221D;
infinity
&infin;
&#x221E;
angle
&ang;
&#x2220;
logical and = wedge
&and;
&#x2227;
logical or = vee
&or;
&#x2228;
intersection = cap
&cap;
&#x2229;
union = cup
&cup;
&#x222A;
integral
&int;
&#x222B;
therefore
&there4;
&#x2234;
tilde operator = varies with = similar to
&sim;
&#x223C;
approximately equal to
&cong;
&#x2245;
almost equal to = asymptotic to
&asymp;
&#x2248;
not equal to
&ne;
&#x2260;
identical to
&equiv;
&#x2261;
less-than or equal to
&le;
&#x2264;
greater-than or equal to
&ge;
&#x2265;
subset of
&sub;
&#x2282;
superset of
&sup;
&#x2283;
not a subset of
&nsub;
&#x2284;
subset of or equal to
&sube;
&#x2286;
superset of or equal to
&supe;
&#x2287;
circled plus = direct sum
&oplus;
&#x2295;
circled times = vector product
&otimes;
&#x2297;
up tack = orthogonal to = perpendicular
&perp;
&#x22A5;
dot operator
&sdot;
&#x22C5;
left ceiling = APL upstile
&lceil;
&#x2308;
right ceiling
&rceil;
&#x2309;
left floor = APL downstile
&lfloor;
&#x230A;
right floor
&rfloor;
&#x230B;
left-pointing angle bracket = bra
&lang;
&#x2329;
right-pointing angle bracket = ket
&rang;
&#x232A;
lozenge
&loz;
&#x25CA;
black spade suit
&spades;
&#x2660;
black club suit = shamrock
&clubs;
&#x2663;
black heart suit = valentine
&hearts;
&#x2665;
black diamond suit
&diams;
&#x2666;


More web tips,templates and tutorials coming soon as part of our "month of web" at OnlineDesignTeacher. Follow us on Twitter and Facebook to be sure you don't miss out.