New in CSS3
CSS3 isn’t that much different from CSS; however are the possibilities much greater. It offers exciting new possibilities to create an impact with your designs, allows you to use more diverse style sheets for a variety of occasions and lots more.
Rounded Borders
.box {
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
}
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
}
Note *This does not work in some versions of Internet Explorer
- border-color
- border-image
- box-shadow
Box Shadow
.box {
box-shadow: 5px 5px 2px black;
-moz-box-shadow: 5px 5px 2px black;
-webkit-box-shadow: 5px 5px 2px black;
}
box-shadow: 5px 5px 2px black;
-moz-box-shadow: 5px 5px 2px black;
-webkit-box-shadow: 5px 5px 2px black;
}
Text Shadow
.font {
font-size: 20px;
color: #2178d9;
}
font-size: 20px;
color: #2178d9;
}
.font {
text-shadow: 0 1px 0 #000;
}
The quick brown fox jumps over the lazy dog
- text-overflow
- word-wrap
Fancy Font
@font-face {
font-family: ‘Loyal’;
src: url(‘loyal.ttf’);
}
.font {
font-family: Loyal;
font-size: 20px;
}
Opacity
.box {
opacity: .6;
}
opacity: .6;
}
RGBA
.box {
background: url(rgba.php?r=239&g=182&b=29&a=.25);
}
background: url(rgba.php?r=239&g=182&b=29&a=.25);
}
- HSL colors
- HSLA colors
- opacity
Background Size
.box {
background: #ccc url(http://d2o0t5hpnwv4c1.cloudfront.net/423_screenr/200×200.jpg) no-repeat;
-webkit-background-size: 50%; /* Safari */
-o-background-size: 50%; /* Opera */
-khtml-background-size: 50%; /* Konqueror */
}
background: #ccc url(http://d2o0t5hpnwv4c1.cloudfront.net/423_screenr/200×200.jpg) no-repeat;
-webkit-background-size: 50%; /* Safari */
-o-background-size: 50%; /* Opera */
-khtml-background-size: 50%; /* Konqueror */
}
- box-sizing
- resize
- outline
- nav-top, nav-right, nav-bottom, nav-left
Multiple Backgrounds
.box {
width: 200px;
height: 150px;
background: url(images/text.png) center center no-repeat, url(images/bg.png) repeat-x;
}
width: 200px;
height: 150px;
background: url(images/text.png) center center no-repeat, url(images/bg.png) repeat-x;
}
- background-origin and background-clip
- background-size
Columns
.columns {
-moz-column-count: 2;
-webkit-column-count: 2;
}
-moz-column-count: 2;
-webkit-column-count: 2;
}
Border Image
.box {
border-width: 20px;
-webkit-border-image: url(images/border.png) 27 round;
-moz-border-image: url(images/border.png) 27 round;
border-image: url(images/border.png) 27 round;
}
border-width: 20px;
-webkit-border-image: url(images/border.png) 27 round;
-moz-border-image: url(images/border.png) 27 round;
border-image: url(images/border.png) 27 round;
}
Animations
.box {
position: relative;
-webkit-transition: top 300ms linear;
}
position: relative;
-webkit-transition: top 300ms linear;
}
.box:hover {
top: 20px;
}
A crash course in advanced CSS3 effects
5 techniques to acquaint you with CSS3
http://www.thecssninja.com/demo/css_accordion/#Section1
http://www.webdesignerwall.com/trends/47-amazing-css3-animation-demos/
http://www.cssplay.co.uk/menu/cssart.html
http://anthonycalzadilla.com/css3-ATAT/index-bones.html
[...] New in CSS3 Branding [...]