anupama hosad
UI Engineer
Anupama H
CSS3 is the latest evolution of the Cascading Style Sheets language and aims at extending CSS2.1
It brings a lot of long-awaited novelties, like rounded corners, shadows, gradients , transitions or animations, as well as new layouts like multi-columns, flexible box or grid layouts.
Earliest drafts started in 1999
background: rgba(0, 0, 0, 0.5);
opacity: 0.6;
/* begins with selector */
div[class^="card-"] {
/* CSS to be applied to all cards */
}
/* ends with selector */
a[href$=".pdf"] {
background-image: url(pdf-icon.png);
}
/* contains selector */
a[href*="google.com"] {
background-image: url(google-icon.png);
}
Example : http://tinyurl.com/muzkq2w
/* background clip - set visible range of background */
background-clip: border-box;
/* background origin - defines background image position */
background-origin: padding-box;
/* background size - resize background image */
background-size: 50% 25%;
/* Multiple backgrounds */
background: url(image1.png), url(image2.png), url(image3.png);
Example : http://codepen.io/chriscoyier/pen/CkFni
- give 'inset' for inside shadow
Example : http://tinyurl.com/prbal4k
.three-col {
column-count: 3;
column-gap: 20px;
column-rule-color: #ccc;
column-rule-style: solid;
column-rule-width: 1px;
}
<img class=”element” src=”image.png” />
<p>Lorem ipsum…</p>
<style>
.element{
shape-outside: url(image.png);
shape-image-threshold: 0.5;
float: left;
}
</style>
transform: rotate(30deg)
transform: scale(0.75,1.25)
transform: skew(30deg,10deg)
transform: translate(100px, 20px)
transform-origin: left top;
/* Transition events */
elem.addEventListener("transitionend", updateTransition, false);
function updateTransition(e) {
console.log("property transitioned" + e.propertyName);
console.log("elapsed time" + elapsedTime);
}
/* Animation events */
elem.addEventListener("animationstart", listener, false);
elem.addEventListener("animationend", listener, false);
elem.addEventListener("animationiteration", listener, false);
function listener(e) {
switch(e.type) {
case "animationstart":
console.log("Started: elapsed time is " + e.elapsedTime);
break;
case "animationend":
console.log("Ended: elapsed time is " + e.elapsedTime);
break;
case "animationiteration":
console.log("New loop started at time " + e.elapsedTime);
break;
}
}
Example : http://csstriggers.com/
By anupama hosad