SlideShare a Scribd company logo
CSS 3
New way of Designing

Renzil D’cruz
http://RenzilDe.com
http://about.me/renzilde
http://linkedin.com/in/renzilde
What is CSS?
• CSS – Cascading Style Sheet
• Used to control the layout and presentation layer of a web page.

Then What is CSS?
• 3 - Latest Version/Standard of css
• It is completely backwards compatible, so you will not have to change
existing designs. Browsers will always support CSS2.
• CSS3 is split up into "modules” rather than just selectors and properties
• The Specification is still under development by W3c
• Lot of css3 modules and properties are supported in few or many modern
browsers today
What is New in CSS3?

• Richness
• Effects

• Interactions
• Typography
• Animations
CSS3 Modules

• Borders

• Selectors

• Backgrounds

• Font Face

• Colors

• Transform

• Gradients

• Transition

• Text Effects

• Animation

• User Interface

• Media Queries
Browser Support
Borders – Border Color
Create cool colored borders / filled effect
• If you have a standard border of X pixels, then you can use up to
X colors on that border, each color registering 1 pixel in width.
• If say you are using a standard border of 10 pixels but only apply 5
or 6 colors, the last color will then be applied to the remaining
standard border width.
Compatibility:
– Currently Firefox is the only browser giving support to the CSS3 bordercolor
Border – Image Create borders using image
• The new CSS3 property border-image is a little tricky, but it can allow you to create flexible
boxes with custom borders
• Eg. border-image:url(border.png) 50 50 50 50 round;
• It has 3 parts
•

An image to use as the border

•

Where to slice that image, dividing the image into 9 sections
–

•

Slice from top right bottom left (pixels/percentage)

How the browser should apply those sections to the edges of your element
–

Repeat, Round, Stretch
•
•
•

Repeat (repeat, or tile, the image) and stretch (stretch, or scale, the image) are pretty self-explanatory.
Round means tile the image but only so that a whole number of tiles fit, and otherwise scale the image.
Right now, Safari and Chrome interpret round as repeat.

Compatibility: currently works in Safari and Firefox 3.1 (Alpha).
Borders – Border Radius
Create Rounded Corners
• #my_CSS3_id {
• border: 10px solid #c4c8cc;

•

-moz-border-radius: 15px;

•

-webkit-border-radius: 15px;

•

border-radius: 15px;

• }
Compatibility:
– The Prefixes:
-moz (e.g. -moz-border-radius) works in Firefox.
-webkit (e.g. -webkit-border-radius) works in Safari & Google Chrome.
Box Shadow
• Used in casting shadows off block-level elements (like divs).
• Eg. .shadow {
-moz-box-shadow: 5px 5px 5px #ccc;
-webkit-box-shadow: 5px 5px 5px #ccc;
box-shadow: 5px 5px 5px #ccc;
-moz-box-shadow: inset 5px 5px 5px #ccc; /* inset */}
• - The horizontal offset of the shadow, positive means the shadow will be on the right of the
box, a negative offset will put the shadow on the left of the box.
• - The vertical offset of the shadow, a negative one means the box-shadow will be above the
box, a positive one means the shadow will be below the box.
• - The blur radius, if set to 0 the shadow will be sharp, the higher the number, the more
blurred it will be.

• - Color
Compatibility: currently works in Firefox, Safari, Chrome and Opera 10.50 pre-alpha:
Backgrounds – Origin
• The background-origin property is used to determine how the
background-position of a background in a certain box is calculated.
• Eg. .origin {
background-image:url('smiley.gif');
background-repeat:no-repeat;
background-position:left;
background-origin:content-box; }

• border-box,
• padding-box and
• content-box
Compatibility: Mozilla, Safari 3 and Konqueror
Background Image - Size
• We can now apply dimension to the bg images
• Eg. .image_size {
background:url(image_1.extention) bottom right norepeat;
•

-moz-background-size: 100px 200px;

•

-o-background-size: 100px 200px;

•

-webkit-background-size: 100px 200px;

}

Compatibility: Opera 9.5, Safari 3 and Konqueror, Firefox latest
Background Image - Multiple
• No need for nested div for multiple bg
• Eg. .multiple_image {
background: url(image_1.extention) top left norepeat,
url(image_2.extention) bottom left no-repeat,
url(image_3.extention) bottom right no-repeat; }
• The first one is on top and than….
Compatibility: Opera 9.5, Safari 3 and Konqueror, Firefox
latest
Colors – rgb/rgba
• a=“alpha” allows to set opacity while specifying the color
• Eg. .alpha {
background:rgba(153, 134, 117, 0.2); height:20px; }

Compatibility: RGBA is currently better supported in Firefox,
Google Chrome and Safari, also not requiring any prefix.

13
Colors – hsl/hsla
• The HSL declaration sets color/color using Hue (H), Saturation (S) and
Lightness (L).
• Eg. .shadow {
background:hsl(320, 100%, 25%); height:20px; }

• Hue is derived from a degree on the color wheel: 0 & 360 being red, around
120 for the greens, 240 for the blues and everything else in between
• Saturation is a percentage: 0% being grayscale and 100% in full color

• Lightness is a percentage: 0% is dark, 50% the average and 100% the lightest
– Color
• Alpha – sets the opacity

Compatibility: HSL & HSLA is currently well supported in Firefox Google
Chrome and Safari, also not requiring any prefix.
Gradients
• Create some nice subtle gradients; or very compelling gradients!

• Eg. .gradient {
background:-moz-linear-gradient(pos, #AAA B, #XXX Y); }
pos = the position of the first colour, giving direction to the gradient
• #AAA = primary colour

• B = where the fade begins (%)
• #XXX = secondary colour
• Y = where the fade begins (%)
• - It becomes complex when it comes to radial gradients, requires lot of experiment to get the
desired effect
• - The suggestion is to used online tools to get the desired gradient

Compatibility : Firefox 3.6 , Safari 4 , Google Chrome
Text – shadow/effects
• Like with the box-shadow effect, we can apply shadows to text
using CSS3.
• Eg. .tShadow {
text-shadow: Apx Bpx Cpx #XXX; /*single*/

}

• Apx = x-axis
• Bpx = y-axis

• Cpx = cast length / feathering
• #XXX = colour as usual

Compatibility: Opera, Konqueror, iCab and Firefox 3.1a,
Text – Overflow
• The text-overflow property specifies what should happen when
text overflows the containing element.
• div.test{
text-overflow:ellipsis;
}
• clip - Clips the text
• ellipsis - Render an ellipsis ("...") to represent clipped text
Compatibility: The text-overflow property is supported in all major
browsers. But support in Firefox works after adding an xml file
Text – Word Wrap
• The word-wrap property was invented by Microsoft and
added to CSS3. It allows long words to be able to be broken
and wrap onto the next line. It takes in two values; normal
or break-word.
• p {word-wrap:break-word;}
• -

normal - This is the same as if the property wasn’t used,

• break word - the long word is broken into two pieces, so
that the second part wraps onto the next line.
Compatibility: This is currently supported in IE, Safari, and
Firefox 3.1 (Alpha).
Interface – resize
• Now specify whether an element can be resized by the user
• Eg. .resize {resize:both;overflow:auto}
• horizontal
• vertical
• both
• In order for the resize property to work, the element must also have an
overflow value set to either “scroll”, “auto”, or “hidden”, or else it has to
inherit one of those values from its parent. Resize will not work if the
overflow value is set to “visible”, which is the default for overflow.

Compatibility: Firefox 4+, Chrome, and Safari.
Interface – Outline Offset
• The outline-offset property offsets an outline, and draws it
beyond the border edge.
• Outlines differ from borders in two ways:
• - Outlines do not take up space
• - Outlines may be non-rectangular (still not clear to me)
• div{

border:2px solid black;
outline:2px solid red;
outline-offset:15px;
}

Compatibility: This currently works in Opera, Safari and Firefox.
Selectors - Attribute
• Substring matching attribute selectors
– Three additional attribute selectors are provided for matching
substrings in the value of an attribute:
– [att^=val] Represents an element with the att attribute whose
value begins with the prefix “val”.
– [att$=val] Represents an element with the att attribute whose value
ends with the suffix “val”.
– [att*=val] Represents an element with the att attribute whose
value contains at least one instance of the substring “val”. Attribute
values must be identifiers or strings.
Selectors – css3 selectors
p:first-of-type - Selects every p element that is the first p element of its parent
p:last-of-type - Selects every p element that is the last p element of its parent
p:only-of-type - Selects every p element that is the only p element of its parent
p:only-child - Selects every p element that is the only child of its parent
p:nth-child(n=2) - Selects every p element that is the second child of its parent
p:nth-last-child(n=2) - Selects every p element that is the second child of its parent, counting
from the last child
p:nth-of-type(n=2) - Selects every p element that is the second p element of its parent
p:nth-last-of-type(n) - Selects every p element that is the second p element of its parent,
counting from the last child
p:last-child - Selects every p element that is the last child of its parent
:root - Selects the document’s root element
p:empty - Selects every p element that has no children (including text nodes)
p:target - URLs with an # followed by an anchor name, link to a certain element within a
document. The element being linked to is the target element.
input:enabled - Selects every enabled input element
input:disabled - Selects every disabled input element

input:checked - Selects every checked input element [only opera]
:not(selector=p) - Selects every element that is not a p element [no browser support this]
::selection - Selects the portion of an element that is selected by a user
@font-face
• - Want to get away from ‘Web Safe’ fonts for some attractive headers AND do it without using
an image? Use CSS 3 and embed a font-face!
- @font-face is not strictly speaking ‘CSS3′; it was originally born in CSS 2 and although not
appearing in CSS 2.1, CSS 3 is attempting to bring it into the standards.
- In order to use a font, we first must call it using the ‘@font-face’ attribute and this must be
done for each individual font we wish to use.
• Formats:
• - TTF - Works in most browsers except IE and iPhone.
• - EOT - IE only.
• - WOFF - Compressed, emerging standard.
• - SVG – iPhone/iPad.

• Make sure you check license of the font before using it
• Need font format for each font style eg. Bold, regular, italics etc.
Transform
• A transform is an effect that lets an element change shape,
size and position.
• With CSS3 transform, we can move, scale, turn, spin, and
stretch elements.
• You can transform your elements using 2D or 3D
transformation.
Transform – 2d 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:

26
Transform – 2d 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:

27
Transform – 2d rotate() method
•

With the rotate() method, the element rotates clockwise at a given degree. Negative values are allowed and rotates the
element counter-clockwise.

28
Transform – 2d 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 (Y-axis):

29
Transform – 2d skew() method
•

With the skew() method, the element turns in a given angle, depending on the parameters given for the horizontal (Xaxis) and the vertical (Y-axis) lines:

30
Transform – 2d matrix() method
•
•

The matrix() method combines all of the 2D transform methods into one.
The matrix method take six parameters, containing mathematic functions, which allows you to: rotate, scale, move
(translate), and skew elements.

31
Transform – 3d rotateX() method
•

With the rotateX() method, the element rotates around its X-axis at a given degree.

32
Transform – 3d rotateY() method
•

With the rotateY() method, the element rotates around its Y-axis at a given degree.

33
Transition
• With CSS3, we can add an effect when changing from one style to
another, without using Flash animations or JavaScripts.
To do this, you must specify two things:
– Specify the CSS property you want to add an effect to

– Specify the duration of the effectt

• Transition can be applied to
- color
- background color
- font-size
- width
- opacity
- position
Animation
• We can create animations, which can replace animated images, Flash
animations, and JavaScripts in many web pages.
• To create animations in CSS3, you will have to learn about the @keyframes
rule.
• The @keyframes rule is where the animation is created. Specify a CSS style
inside the @keyframes rule and the animation will gradually change from the
current style to the new style.
• When the animation is created in the @keyframe, bind it to a selector,
otherwise the animation will have no effect.
• Bind the animation to a selector by specifying at least these two CSS3
animation properties:
• Specify the name of the animation
• Specify the duration of the animation
CSS3 Resources
• http://robertnyman.com/css3/
• http://www.css3.info/preview/
• http://www.zenelements.com/blog/

• http://css-tricks.com/snippets/css/
• http://www.w3schools.com
• http://www.impressivewebs.com/

CSS3 Support
• http://www.w3schools.com/cssref/css3_browsersupport.asp

• http://findmebyip.com/litmus/
CSS3 websites - Tools
•

http://selectivizr.com/ - Support for selectors

•

http://css3pie.com/ - support for ie6-9

•

http://www.modernizr.com/ - applies class depending on the css3 properties for us to control the progressive
enhancement

•

http://www.findmebyip.com/litmus/#target-selector - check the support

•

http://www.layerstyles.org/builder.html

•

http://www.wordpressthemeshock.com/css-drop-shadow/

•

http://border-radius.com/

•

http://css-tricks.com/examples/ButtonMaker/

•

http://gradients.glrzad.com/

•

http://css3generator.com/

•

http://gradients.glrzad.com/
Thank You.
• Questions ???

• Comments #@$%
• Concerns !!!

Be Creative!!!
facebook.com/renzilde
twitter.com/renzilde
linkedin.com/in/renzilde

More Related Content

PPTX
Doing More With Less
KEY
Sass, Compass
PDF
Compass, Sass, and the Enlightened CSS Developer
PPTX
Cascading style sheet part 2
PDF
10 Advanced CSS Techniques (You Wish You Knew More About)
PPTX
Colors In CSS3
PPT
PDF
CSS3: Simply Responsive
Doing More With Less
Sass, Compass
Compass, Sass, and the Enlightened CSS Developer
Cascading style sheet part 2
10 Advanced CSS Techniques (You Wish You Knew More About)
Colors In CSS3
CSS3: Simply Responsive

What's hot (13)

PPTX
Css 3
PPTX
Css 3
PDF
CSS3 - is everything we used to do wrong?
KEY
Bringing sexy back to CSS: SASS/SCSS, LESS and Compass
PPTX
SASS is more than LESS
KEY
Wrangling the CSS Beast with Sass
PDF
CSS3: Ripe and Ready to Respond
KEY
Sass, Compass and the new tools - Open Web Camp IV
PDF
PDF
Mobile-first OOCSS, Sass & Compass at BBC Responsive News
PPT
CSS Preprocessors: LESS is more or look SASS-y trying
PDF
Beautiful Web Typography (#5)
Css 3
Css 3
CSS3 - is everything we used to do wrong?
Bringing sexy back to CSS: SASS/SCSS, LESS and Compass
SASS is more than LESS
Wrangling the CSS Beast with Sass
CSS3: Ripe and Ready to Respond
Sass, Compass and the new tools - Open Web Camp IV
Mobile-first OOCSS, Sass & Compass at BBC Responsive News
CSS Preprocessors: LESS is more or look SASS-y trying
Beautiful Web Typography (#5)
Ad

Viewers also liked (10)

PPTX
Project on SBI
PPTX
State bank of india
PPT
E banking service of sbi bank
PPTX
ONLINE BANKING
PPTX
Finacle - Banking & Technology Trends 2013 | Technology Innovations
PPTX
Online banking
PPT
Technology In Indian Banking 2008
PPT
E banking service of sbi bank
PDF
E commerce project
DOCX
Thesis: THE ROLE OF INFORMATION TECHNOLOGY ON COMMERCIAL BANKS IN NIGERIA
Project on SBI
State bank of india
E banking service of sbi bank
ONLINE BANKING
Finacle - Banking & Technology Trends 2013 | Technology Innovations
Online banking
Technology In Indian Banking 2008
E banking service of sbi bank
E commerce project
Thesis: THE ROLE OF INFORMATION TECHNOLOGY ON COMMERCIAL BANKS IN NIGERIA
Ad

Similar to Css3 (20)

PPT
Web development basics (Part-2)
KEY
Trendsetting: Web Design and Beyond
PPTX
CSS3 basics for beginners - Imrokraft
PPTX
CSS tutorial chapter 2
KEY
Advanced sass/compass
PDF
Accelerated Stylesheets
PPTX
MTA managing the graphical interface by using css
KEY
CSS and CSS3
PPT
Web development basics (Part-3)
PDF
Big Design Conference: CSS3
PPTX
Bootstrap SLIDES for web development course
PDF
DotNetNuke World CSS3
PDF
CSS3: Ripe and Ready to Respond
PPTX
Css3 shubelal
PPTX
PPTX
Unit - 3 CSS(Cascading Style Sheet).pptx
PPTX
CSS3: Background And DropShadows:
PPTX
Website trends 2012 presentation
PDF
[WebVisions 2010] CSS3 Workshop (Afternoon)
PDF
CSS3 Backgrounds
Web development basics (Part-2)
Trendsetting: Web Design and Beyond
CSS3 basics for beginners - Imrokraft
CSS tutorial chapter 2
Advanced sass/compass
Accelerated Stylesheets
MTA managing the graphical interface by using css
CSS and CSS3
Web development basics (Part-3)
Big Design Conference: CSS3
Bootstrap SLIDES for web development course
DotNetNuke World CSS3
CSS3: Ripe and Ready to Respond
Css3 shubelal
Unit - 3 CSS(Cascading Style Sheet).pptx
CSS3: Background And DropShadows:
Website trends 2012 presentation
[WebVisions 2010] CSS3 Workshop (Afternoon)
CSS3 Backgrounds

More from Renzil D'cruz (20)

PDF
Gateway to maximize ad revenue
PDF
Multinational’s lackadaisical attitude led to world’s worst industrial disaster
PDF
to-do checklist for Web Developer
PDF
Mean, median, mode, Standard deviation for grouped data for Statistical Measu...
PDF
Market Research to Understand Behavior of sales wrt Price and flavor
PDF
Paathbal(पाठबळ) is Online platform to help to the working poor (Business Plan)
PDF
Maintenance Methodology & Systems in Manufacturing : Operations Reserch
PDF
Online advertising
PDF
Marketing mix of Apple iPad
PDF
Mean, median, mode, Standard deviation for grouped data for Statistical Measu...
PDF
Project Report on Zensar Technologies for Managerial Economics
PDF
Project Report on Zensar Technologies for Managerial Economics
PDF
Managerial Accounts : Financial Statements For Aptech Ltd.
PDF
Linkedin professionals network
PDF
Business Plan : LayZee Bean Bags
PDF
Integrated marketing communication : Advertisement Detail
PDF
Project on Greece Crisis and Impact for Economic Environment of Business
PDF
Google story secrets of multibillion sucessesful company
PDF
Google apps smartest way of working
PDF
Project on Greece Crisis and Impact for Economic Environment of Business
Gateway to maximize ad revenue
Multinational’s lackadaisical attitude led to world’s worst industrial disaster
to-do checklist for Web Developer
Mean, median, mode, Standard deviation for grouped data for Statistical Measu...
Market Research to Understand Behavior of sales wrt Price and flavor
Paathbal(पाठबळ) is Online platform to help to the working poor (Business Plan)
Maintenance Methodology & Systems in Manufacturing : Operations Reserch
Online advertising
Marketing mix of Apple iPad
Mean, median, mode, Standard deviation for grouped data for Statistical Measu...
Project Report on Zensar Technologies for Managerial Economics
Project Report on Zensar Technologies for Managerial Economics
Managerial Accounts : Financial Statements For Aptech Ltd.
Linkedin professionals network
Business Plan : LayZee Bean Bags
Integrated marketing communication : Advertisement Detail
Project on Greece Crisis and Impact for Economic Environment of Business
Google story secrets of multibillion sucessesful company
Google apps smartest way of working
Project on Greece Crisis and Impact for Economic Environment of Business

Recently uploaded (20)

PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Spectroscopy.pptx food analysis technology
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Cloud computing and distributed systems.
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Dropbox Q2 2025 Financial Results & Investor Presentation
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Spectroscopy.pptx food analysis technology
Building Integrated photovoltaic BIPV_UPV.pdf
Programs and apps: productivity, graphics, security and other tools
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Encapsulation theory and applications.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Mobile App Security Testing_ A Comprehensive Guide.pdf
Review of recent advances in non-invasive hemoglobin estimation
Diabetes mellitus diagnosis method based random forest with bat algorithm
Empathic Computing: Creating Shared Understanding
Big Data Technologies - Introduction.pptx
Cloud computing and distributed systems.
MIND Revenue Release Quarter 2 2025 Press Release
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Advanced methodologies resolving dimensionality complications for autism neur...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx

Css3

  • 1. CSS 3 New way of Designing Renzil D’cruz http://RenzilDe.com http://about.me/renzilde http://linkedin.com/in/renzilde
  • 2. What is CSS? • CSS – Cascading Style Sheet • Used to control the layout and presentation layer of a web page. Then What is CSS? • 3 - Latest Version/Standard of css • It is completely backwards compatible, so you will not have to change existing designs. Browsers will always support CSS2. • CSS3 is split up into "modules” rather than just selectors and properties • The Specification is still under development by W3c • Lot of css3 modules and properties are supported in few or many modern browsers today
  • 3. What is New in CSS3? • Richness • Effects • Interactions • Typography • Animations
  • 4. CSS3 Modules • Borders • Selectors • Backgrounds • Font Face • Colors • Transform • Gradients • Transition • Text Effects • Animation • User Interface • Media Queries
  • 6. Borders – Border Color Create cool colored borders / filled effect • If you have a standard border of X pixels, then you can use up to X colors on that border, each color registering 1 pixel in width. • If say you are using a standard border of 10 pixels but only apply 5 or 6 colors, the last color will then be applied to the remaining standard border width. Compatibility: – Currently Firefox is the only browser giving support to the CSS3 bordercolor
  • 7. Border – Image Create borders using image • The new CSS3 property border-image is a little tricky, but it can allow you to create flexible boxes with custom borders • Eg. border-image:url(border.png) 50 50 50 50 round; • It has 3 parts • An image to use as the border • Where to slice that image, dividing the image into 9 sections – • Slice from top right bottom left (pixels/percentage) How the browser should apply those sections to the edges of your element – Repeat, Round, Stretch • • • Repeat (repeat, or tile, the image) and stretch (stretch, or scale, the image) are pretty self-explanatory. Round means tile the image but only so that a whole number of tiles fit, and otherwise scale the image. Right now, Safari and Chrome interpret round as repeat. Compatibility: currently works in Safari and Firefox 3.1 (Alpha).
  • 8. Borders – Border Radius Create Rounded Corners • #my_CSS3_id { • border: 10px solid #c4c8cc; • -moz-border-radius: 15px; • -webkit-border-radius: 15px; • border-radius: 15px; • } Compatibility: – The Prefixes: -moz (e.g. -moz-border-radius) works in Firefox. -webkit (e.g. -webkit-border-radius) works in Safari & Google Chrome.
  • 9. Box Shadow • Used in casting shadows off block-level elements (like divs). • Eg. .shadow { -moz-box-shadow: 5px 5px 5px #ccc; -webkit-box-shadow: 5px 5px 5px #ccc; box-shadow: 5px 5px 5px #ccc; -moz-box-shadow: inset 5px 5px 5px #ccc; /* inset */} • - The horizontal offset of the shadow, positive means the shadow will be on the right of the box, a negative offset will put the shadow on the left of the box. • - The vertical offset of the shadow, a negative one means the box-shadow will be above the box, a positive one means the shadow will be below the box. • - The blur radius, if set to 0 the shadow will be sharp, the higher the number, the more blurred it will be. • - Color Compatibility: currently works in Firefox, Safari, Chrome and Opera 10.50 pre-alpha:
  • 10. Backgrounds – Origin • The background-origin property is used to determine how the background-position of a background in a certain box is calculated. • Eg. .origin { background-image:url('smiley.gif'); background-repeat:no-repeat; background-position:left; background-origin:content-box; } • border-box, • padding-box and • content-box Compatibility: Mozilla, Safari 3 and Konqueror
  • 11. Background Image - Size • We can now apply dimension to the bg images • Eg. .image_size { background:url(image_1.extention) bottom right norepeat; • -moz-background-size: 100px 200px; • -o-background-size: 100px 200px; • -webkit-background-size: 100px 200px; } Compatibility: Opera 9.5, Safari 3 and Konqueror, Firefox latest
  • 12. Background Image - Multiple • No need for nested div for multiple bg • Eg. .multiple_image { background: url(image_1.extention) top left norepeat, url(image_2.extention) bottom left no-repeat, url(image_3.extention) bottom right no-repeat; } • The first one is on top and than…. Compatibility: Opera 9.5, Safari 3 and Konqueror, Firefox latest
  • 13. Colors – rgb/rgba • a=“alpha” allows to set opacity while specifying the color • Eg. .alpha { background:rgba(153, 134, 117, 0.2); height:20px; } Compatibility: RGBA is currently better supported in Firefox, Google Chrome and Safari, also not requiring any prefix. 13
  • 14. Colors – hsl/hsla • The HSL declaration sets color/color using Hue (H), Saturation (S) and Lightness (L). • Eg. .shadow { background:hsl(320, 100%, 25%); height:20px; } • Hue is derived from a degree on the color wheel: 0 & 360 being red, around 120 for the greens, 240 for the blues and everything else in between • Saturation is a percentage: 0% being grayscale and 100% in full color • Lightness is a percentage: 0% is dark, 50% the average and 100% the lightest – Color • Alpha – sets the opacity Compatibility: HSL & HSLA is currently well supported in Firefox Google Chrome and Safari, also not requiring any prefix.
  • 15. Gradients • Create some nice subtle gradients; or very compelling gradients! • Eg. .gradient { background:-moz-linear-gradient(pos, #AAA B, #XXX Y); } pos = the position of the first colour, giving direction to the gradient • #AAA = primary colour • B = where the fade begins (%) • #XXX = secondary colour • Y = where the fade begins (%) • - It becomes complex when it comes to radial gradients, requires lot of experiment to get the desired effect • - The suggestion is to used online tools to get the desired gradient Compatibility : Firefox 3.6 , Safari 4 , Google Chrome
  • 16. Text – shadow/effects • Like with the box-shadow effect, we can apply shadows to text using CSS3. • Eg. .tShadow { text-shadow: Apx Bpx Cpx #XXX; /*single*/ } • Apx = x-axis • Bpx = y-axis • Cpx = cast length / feathering • #XXX = colour as usual Compatibility: Opera, Konqueror, iCab and Firefox 3.1a,
  • 17. Text – Overflow • The text-overflow property specifies what should happen when text overflows the containing element. • div.test{ text-overflow:ellipsis; } • clip - Clips the text • ellipsis - Render an ellipsis ("...") to represent clipped text Compatibility: The text-overflow property is supported in all major browsers. But support in Firefox works after adding an xml file
  • 18. Text – Word Wrap • The word-wrap property was invented by Microsoft and added to CSS3. It allows long words to be able to be broken and wrap onto the next line. It takes in two values; normal or break-word. • p {word-wrap:break-word;} • - normal - This is the same as if the property wasn’t used, • break word - the long word is broken into two pieces, so that the second part wraps onto the next line. Compatibility: This is currently supported in IE, Safari, and Firefox 3.1 (Alpha).
  • 19. Interface – resize • Now specify whether an element can be resized by the user • Eg. .resize {resize:both;overflow:auto} • horizontal • vertical • both • In order for the resize property to work, the element must also have an overflow value set to either “scroll”, “auto”, or “hidden”, or else it has to inherit one of those values from its parent. Resize will not work if the overflow value is set to “visible”, which is the default for overflow. Compatibility: Firefox 4+, Chrome, and Safari.
  • 20. Interface – Outline Offset • The outline-offset property offsets an outline, and draws it beyond the border edge. • Outlines differ from borders in two ways: • - Outlines do not take up space • - Outlines may be non-rectangular (still not clear to me) • div{ border:2px solid black; outline:2px solid red; outline-offset:15px; } Compatibility: This currently works in Opera, Safari and Firefox.
  • 21. Selectors - Attribute • Substring matching attribute selectors – Three additional attribute selectors are provided for matching substrings in the value of an attribute: – [att^=val] Represents an element with the att attribute whose value begins with the prefix “val”. – [att$=val] Represents an element with the att attribute whose value ends with the suffix “val”. – [att*=val] Represents an element with the att attribute whose value contains at least one instance of the substring “val”. Attribute values must be identifiers or strings.
  • 22. Selectors – css3 selectors p:first-of-type - Selects every p element that is the first p element of its parent p:last-of-type - Selects every p element that is the last p element of its parent p:only-of-type - Selects every p element that is the only p element of its parent p:only-child - Selects every p element that is the only child of its parent p:nth-child(n=2) - Selects every p element that is the second child of its parent p:nth-last-child(n=2) - Selects every p element that is the second child of its parent, counting from the last child p:nth-of-type(n=2) - Selects every p element that is the second p element of its parent p:nth-last-of-type(n) - Selects every p element that is the second p element of its parent, counting from the last child
  • 23. p:last-child - Selects every p element that is the last child of its parent :root - Selects the document’s root element p:empty - Selects every p element that has no children (including text nodes) p:target - URLs with an # followed by an anchor name, link to a certain element within a document. The element being linked to is the target element. input:enabled - Selects every enabled input element input:disabled - Selects every disabled input element input:checked - Selects every checked input element [only opera] :not(selector=p) - Selects every element that is not a p element [no browser support this] ::selection - Selects the portion of an element that is selected by a user
  • 24. @font-face • - Want to get away from ‘Web Safe’ fonts for some attractive headers AND do it without using an image? Use CSS 3 and embed a font-face! - @font-face is not strictly speaking ‘CSS3′; it was originally born in CSS 2 and although not appearing in CSS 2.1, CSS 3 is attempting to bring it into the standards. - In order to use a font, we first must call it using the ‘@font-face’ attribute and this must be done for each individual font we wish to use. • Formats: • - TTF - Works in most browsers except IE and iPhone. • - EOT - IE only. • - WOFF - Compressed, emerging standard. • - SVG – iPhone/iPad. • Make sure you check license of the font before using it • Need font format for each font style eg. Bold, regular, italics etc.
  • 25. Transform • A transform is an effect that lets an element change shape, size and position. • With CSS3 transform, we can move, scale, turn, spin, and stretch elements. • You can transform your elements using 2D or 3D transformation.
  • 26. Transform – 2d 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: 26
  • 27. Transform – 2d 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: 27
  • 28. Transform – 2d rotate() method • With the rotate() method, the element rotates clockwise at a given degree. Negative values are allowed and rotates the element counter-clockwise. 28
  • 29. Transform – 2d 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 (Y-axis): 29
  • 30. Transform – 2d skew() method • With the skew() method, the element turns in a given angle, depending on the parameters given for the horizontal (Xaxis) and the vertical (Y-axis) lines: 30
  • 31. Transform – 2d matrix() method • • The matrix() method combines all of the 2D transform methods into one. The matrix method take six parameters, containing mathematic functions, which allows you to: rotate, scale, move (translate), and skew elements. 31
  • 32. Transform – 3d rotateX() method • With the rotateX() method, the element rotates around its X-axis at a given degree. 32
  • 33. Transform – 3d rotateY() method • With the rotateY() method, the element rotates around its Y-axis at a given degree. 33
  • 34. Transition • With CSS3, we can add an effect when changing from one style to another, without using Flash animations or JavaScripts. To do this, you must specify two things: – Specify the CSS property you want to add an effect to – Specify the duration of the effectt • Transition can be applied to - color - background color - font-size - width - opacity - position
  • 35. Animation • We can create animations, which can replace animated images, Flash animations, and JavaScripts in many web pages. • To create animations in CSS3, you will have to learn about the @keyframes rule. • The @keyframes rule is where the animation is created. Specify a CSS style inside the @keyframes rule and the animation will gradually change from the current style to the new style. • When the animation is created in the @keyframe, bind it to a selector, otherwise the animation will have no effect. • Bind the animation to a selector by specifying at least these two CSS3 animation properties: • Specify the name of the animation • Specify the duration of the animation
  • 36. CSS3 Resources • http://robertnyman.com/css3/ • http://www.css3.info/preview/ • http://www.zenelements.com/blog/ • http://css-tricks.com/snippets/css/ • http://www.w3schools.com • http://www.impressivewebs.com/ CSS3 Support • http://www.w3schools.com/cssref/css3_browsersupport.asp • http://findmebyip.com/litmus/
  • 37. CSS3 websites - Tools • http://selectivizr.com/ - Support for selectors • http://css3pie.com/ - support for ie6-9 • http://www.modernizr.com/ - applies class depending on the css3 properties for us to control the progressive enhancement • http://www.findmebyip.com/litmus/#target-selector - check the support • http://www.layerstyles.org/builder.html • http://www.wordpressthemeshock.com/css-drop-shadow/ • http://border-radius.com/ • http://css-tricks.com/examples/ButtonMaker/ • http://gradients.glrzad.com/ • http://css3generator.com/ • http://gradients.glrzad.com/
  • 38. Thank You. • Questions ??? • Comments #@$% • Concerns !!! Be Creative!!! facebook.com/renzilde twitter.com/renzilde linkedin.com/in/renzilde