SlideShare une entreprise Scribd logo
1  sur  38
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

SASS is more than LESS
SASS is more than LESSSASS is more than LESS
SASS is more than LESS
Itai Koren
 
Sass, Compass and the new tools - Open Web Camp IV
Sass, Compass and the new tools - Open Web Camp IVSass, Compass and the new tools - Open Web Camp IV
Sass, Compass and the new tools - Open Web Camp IV
Dirk Ginader
 
Mobile-first OOCSS, Sass & Compass at BBC Responsive News
Mobile-first OOCSS, Sass & Compass at BBC Responsive NewsMobile-first OOCSS, Sass & Compass at BBC Responsive News
Mobile-first OOCSS, Sass & Compass at BBC Responsive News
Kaelig Deloumeau-Prigent
 

Tendances (13)

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

En vedette

Online banking
Online bankingOnline banking
Online banking
Preet Raj
 
E banking service of sbi bank
E banking service of sbi bankE banking service of sbi bank
E banking service of sbi bank
Raku Daku
 

En vedette (11)

Project on SBI
Project on SBIProject on SBI
Project on SBI
 
State bank of india
State bank of indiaState bank of india
State bank of india
 
E banking service of sbi bank
E banking service of sbi bankE banking service of sbi bank
E banking service of sbi bank
 
ONLINE BANKING
ONLINE   BANKINGONLINE   BANKING
ONLINE BANKING
 
Finacle - Banking & Technology Trends 2013 | Technology Innovations
Finacle - Banking & Technology Trends 2013 | Technology InnovationsFinacle - Banking & Technology Trends 2013 | Technology Innovations
Finacle - Banking & Technology Trends 2013 | Technology Innovations
 
Online banking
Online bankingOnline banking
Online banking
 
Technology In Indian Banking 2008
Technology In Indian Banking 2008Technology In Indian Banking 2008
Technology In Indian Banking 2008
 
E banking service of sbi bank
E banking service of sbi bankE banking service of sbi bank
E banking service of sbi bank
 
E commerce project
E commerce project E commerce project
E commerce project
 
Credit appraisal in sbi bank project6 report
Credit appraisal in  sbi bank project6 report Credit appraisal in  sbi bank project6 report
Credit appraisal in sbi bank project6 report
 
Thesis: THE ROLE OF INFORMATION TECHNOLOGY ON COMMERCIAL BANKS IN NIGERIA
Thesis: THE ROLE OF INFORMATION TECHNOLOGY ON COMMERCIAL BANKS IN NIGERIAThesis: THE ROLE OF INFORMATION TECHNOLOGY ON COMMERCIAL BANKS IN NIGERIA
Thesis: THE ROLE OF INFORMATION TECHNOLOGY ON COMMERCIAL BANKS IN NIGERIA
 

Similaire à Css3

Big Design Conference: CSS3
Big Design Conference: CSS3 Big Design Conference: CSS3
Big Design Conference: CSS3
Wynn Netherland
 
Website trends 2012 presentation
Website trends 2012 presentationWebsite trends 2012 presentation
Website trends 2012 presentation
Fresh_Egg
 
[WebVisions 2010] CSS3 Workshop (Afternoon)
[WebVisions 2010] CSS3 Workshop (Afternoon)[WebVisions 2010] CSS3 Workshop (Afternoon)
[WebVisions 2010] CSS3 Workshop (Afternoon)
Christopher Schmitt
 

Similaire à Css3 (20)

Web development basics (Part-2)
Web development basics (Part-2)Web development basics (Part-2)
Web development basics (Part-2)
 
Trendsetting: Web Design and Beyond
Trendsetting: Web Design and BeyondTrendsetting: Web Design and Beyond
Trendsetting: Web Design and Beyond
 
CSS3 basics for beginners - Imrokraft
CSS3 basics for beginners - ImrokraftCSS3 basics for beginners - Imrokraft
CSS3 basics for beginners - Imrokraft
 
CSS tutorial chapter 2
CSS tutorial chapter 2CSS tutorial chapter 2
CSS tutorial chapter 2
 
Advanced sass/compass
Advanced sass/compassAdvanced sass/compass
Advanced sass/compass
 
Accelerated Stylesheets
Accelerated StylesheetsAccelerated Stylesheets
Accelerated Stylesheets
 
MTA managing the graphical interface by using css
MTA managing the graphical interface by using cssMTA managing the graphical interface by using css
MTA managing the graphical interface by using css
 
CSS and CSS3
CSS and CSS3CSS and CSS3
CSS and CSS3
 
Web development basics (Part-3)
Web development basics (Part-3)Web development basics (Part-3)
Web development basics (Part-3)
 
Big Design Conference: CSS3
Big Design Conference: CSS3 Big Design Conference: CSS3
Big Design Conference: CSS3
 
DotNetNuke World CSS3
DotNetNuke World CSS3DotNetNuke World CSS3
DotNetNuke World CSS3
 
CSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to RespondCSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to Respond
 
Css3 shubelal
Css3   shubelalCss3   shubelal
Css3 shubelal
 
CSS 3
CSS 3CSS 3
CSS 3
 
Unit - 3 CSS(Cascading Style Sheet).pptx
Unit - 3 CSS(Cascading Style Sheet).pptxUnit - 3 CSS(Cascading Style Sheet).pptx
Unit - 3 CSS(Cascading Style Sheet).pptx
 
CSS3: Background And DropShadows:
CSS3: Background And DropShadows:CSS3: Background And DropShadows:
CSS3: Background And DropShadows:
 
Website trends 2012 presentation
Website trends 2012 presentationWebsite trends 2012 presentation
Website trends 2012 presentation
 
[WebVisions 2010] CSS3 Workshop (Afternoon)
[WebVisions 2010] CSS3 Workshop (Afternoon)[WebVisions 2010] CSS3 Workshop (Afternoon)
[WebVisions 2010] CSS3 Workshop (Afternoon)
 
CSS3 Backgrounds
CSS3 BackgroundsCSS3 Backgrounds
CSS3 Backgrounds
 
Css3
Css3Css3
Css3
 

Plus de Renzil D'cruz

Plus de Renzil D'cruz (20)

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

Dernier

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Dernier (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 

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