Confidential ©2009 Syntel, Inc
Confidential ©2009 Syntel, Inc
Confidential
Iconic Representations.......
Test your
Memory
Queries
Objective
Need more
Info
Introduction to Hibernate
Confidential
Coffee
Break
Brainstor
m
Can you
Solve?
Demo
FAQ
Recap
CSS 3
CSS3 stands for Cascading Style Sheet.
CSS defines how HTML elements are to be displayed.
CSS3 is the latest standard for CSS.
CSS3 is completely backwards-compatible with earlier
versions of CSS.
Confidential
Vendor Prefixes
Some CSS rules wont work without the vendor prefix.
Mozilla Browsers (Firefox)
-moz
Webkit Browsers (Safari, Chrome)
-webkit
Opera
-o
Internet Explorer
-ms
Confidential
CSS 3 Modules
CSS3 has been split into "modules".
It contains the "old CSS specification which has been split
into smaller pieces.
Most of the CSS3 Modules are W3C Recommendations,
and CSS3 properties are implemented in all modern
browsers.
Some of the important CSS3 modules are:
New Selectors
New Pseudo elements
New Pseudo classes
New Properties
Animations
Transitions
Transform
Confidential
New Selectors
Begins with selector:
The begins with selector uses the caret (^) character to
match an element with an attribute value beginning with the
value specified in the selector.
a[href^="https"]
{
color:red;
border-bottom:1px dotted;
}
In this code snippet Only the links containing https at the
beginning of their href values are selected.
Confidential
New Selectors
Ends with selector:
The ends with selector uses the dollar sign ($) to match
an element with an attribute value ending with the value
specified.
a[href$=".pdf"]
{
background: url('images/pdf.png')
no-repeat 0 2px;
padding-left: 25px;
}
The PDF file icon will be rendered next to the link because the
browser will match the href string ending with .pdf.
Confidential
New Selectors
Contains selector:
The contains selector uses the asterisk character (*) to
match an element with an attribute value containing at least
one instance of the value specified.
img[src*="thumbnails"]
{
border: 5px solid #000;
}
we can select only the images containing thumbnails
anywhere in the src attributes value.
Confidential
Confidential
Confidential
Confidential
li:first-child
{
background:
yellow;
}
It selects the first <li> child element in the list.
Confidential
p:last-child
{
background: red;
}
It selects a background color for the <p> element that is the
last child of its parent.
Confidential
p:only-child
{
background: red;
}
It specifies a background color for every <p> element that
is the only child of its parent.
Confidential
New Properties
Animations:
CSS3 animations can replace animations created by Flash
and JavaScript in existing web pages.
The @keyframes rule is where the animation is created.
When an animation is created in the @keyframe rule, you
must bind it to a selector, otherwise the animation will have no
effect.
Confidential
New Properties
Bind the animation to a selector (element) by specifying at
least these two properties:
the name of the animation
the duration of the animation
Confidential
New Properties
Code Snippet:
/* Standard syntax */
@keyframes myfirst {
0% {background: red;}
25% {background: yellow;}
50% {background: blue;}
100% {background: green;}
}
Here we can change the background color when the animation
is 25%, and 50%, and again when the animation is 100%
complete.
Confidential
New Properties
Transitions
CSS3 transitions are effects that let an element gradually
change from one style to another.
For transitions we specify 2 things:
Confidential
New Properties
Code Snippet:
div
{
-webkit-transition: width 2s; /* For
Safari 3.1 to 6.0 */
transition: width 2s;
}
This will add a transition effect on the width property, with a
duration of 2 seconds.
Confidential
New Properties
Code Snippet:
div
{
-webkit-transition: width 2s, height 2s,
-webkit-transform 2s; /* For Safari 3.1 to 6.0 */
transition: width 2s, height 2s, transform 2s;
}
This will add transition effects on width, height, and
transformation using multiple changes by separating comma.
Confidential
New Properties
Transformations:
A transformation is an effect that lets an element change
shape, size and position.
You can transform your elements using 2D or 3D
transformation.
With CSS3 transform, we can move, scale, turn, spin, and
stretch elements.
2d transform methods:
Confidential
translate()
rotate()
scale()
New Properties
Translate() method:
With the translate() method, the element moves from its current
position, depending on the parameters given for the left (X-axis) and the
top (Y-axis) position.
div
{
-ms-transform: ranslate(50px,100px);
-webkit-transform: translate(50px,100px);
transform: translate(50px,100px);
}
It will translates the value (50px,100px) and also moves the
element 50 pixels from the left, and 100 pixels from the top.
Confidential
New Properties
Rotate() method:
With the rotate() method, the element rotates clockwise at a given
degree. Negative values are allowed and rotates the element
counter-clockwise.
div
{
-ms-transform: rotate(30deg);
-webkit-transform: rotate(30deg);
transform: rotate(30deg);
}
Here it will rotates the element clockwise 30 degrees.
Confidential
New Properties
Scale() method:
With the scale() method, the element increases or decreases the size,
depending on the parameters given for the width (X-axis) and the height (Yaxis).
div {
-ms-transform: scale(2,4);
-webkit-transform: scale(2,4);
transform: scale(2,4);
}
Here the value scale(2,4) transforms the width to be twice its original size,
and the height 4 times its original size.
Confidential
References
Websites:
www.w3schools.com
https://www.codeschool.com
www.css3-tutorial.net/
Books:
Confidential
Thanks
Thank You
Confidential