SlideShare une entreprise Scribd logo
1  sur  54
Télécharger pour lire hors ligne
UpWeb Esprit 2014/2015
GETTING STARTED WITH CSS3
Agenda
 Introduction to CSS3
 CSS3 Borders
 CSS3 Backgrounds
 CSS3 Text Effects
 CSS3 Fonts
 CSS3 2D Transforms
 CSS3 3D Transforms
 CSS3 Transitions
 CSS3 Animations
 CSS3 Multiple columns
 CSS3 selectors
2
1. Introduction to CSS3
1.1 What Is CSS3 and why we need to use it?
 Successor of CSS2
 It comes with new modules
 Below is a non exhaustive list of features that tend to be labelled as ―css3" in
the medias:
 Someof the most important CSS3modulesare:
 Selectors
 Box Model
 Backgroundsand Borders
 Text Effects
 2D/3D Transformations
 Animations
 MultipleColumn Layout
 User Interface
3
2. CSS3 Borders
With CSS3, you cancreaterounded borders, add shadow to boxes, and use an imageasa border -
without using a designprogram, like Photoshop
4
2. CSS3 Borders
5
2. CSS3 Borders
6
2. CSS3 Borders
7
2. CSS3 Borders
8
2. CSS3 Borders
9
2. CSS3 Borders
10
2. CSS3 Borders
11
2. CSS3 Borders
12
2. CSS3 Borders
13
2. CSS3 Borders
14
2. CSS3 Borders
15
3. CSS3 Background
we will be taking a look at the new background properties. Theseincludebackground size, using
more thanone background for an element, and background origin(which effectsthepositionof a
background).
The new featuresallow greater controlof the background element and will provide designerswith a
whole arrayof new possibilities.
Multiple Backgrounds
The new abilitytouse multiplebackgroundsisa great timesaver, allowing you to achieveeffects
which previously required morethanone div. Whether it will be possibleto combinethiswith
background-sizewill be interesting tosee.
The examplebelow uses one background for the top border, one repeated verticallyfor theleft and
right bordersand a third at the bottom.
16
4. CSS3 Text effects
In thistutorialwewill learn how to use CSS Styles to givestylish effects to text.
Learn how to createshadow effects, inset effects, neon style effects, glossy styles, grungestyle effects
and more!
17
4. CSS3 Text effects
18
4. CSS3 Text effects
19
4. CSS3 Text effects
20
3. CSS3 Text effects
21
4. CSS3 fontsSteps to Use the fonts
We'll follow these steps to applythe fonts to your webpage.
→ Download Fonts
→ Convert themOnline
→ Use the StylesheetCode
→ Use Anywhere
→ Download Fonts
Thereare manywebsitewhere you can download fonts for free.
Here are few websitewith a hugecollection of free as well as paid fonts.
› dafont.com, urbanfonts.com,1001freefonts.com ‹
Choose the font you like and download it.
→ Convert The Fonts
The downloaded fonts will work on most of the browsersbut won't work on IE.
To makethe fonts appear on IE we'll have to convert it to a format(eot) that IEunderstands.
How to Convert
Thereare manysoftware'savailable on the internet, most of them paid.
Here's a websitewhere we canconvert the TTFfont to EOT font for IE for Free!
› Online TTF To EOT converter ‹
Upload thefont you want to convert on thiswebsiteand thendownload the converted font.
Noticethefont extensionbefore converting wasTTF after converting changestoEOT.
Keep both these files in the same folderFonts.
22
4. CSS3 fonts
23
5. CSS3 fonts
24
5. CSS3 fonts
25
6. CSS3 shadows
26
6. CSS3 shadows
27
6. CSS3 shadows
28
6. CSS3 shadows
29
6. CSS3 shadows
30
6. CSS3 Transforms & Transitions
Transforms
CSS3 transform propertyletsyou translate, rotate, scale, or skew any element on thepage.
Whilesome of these effectswere possible using previously existing CSS features
(like relativeand absolutepositioning), CSS3givesyou unprecedented controlover many moreaspects
of an element’s appearance.
Translation
Translationfunctionsallow you to move elements left, right, up, or down.
These functionsaresimilar tothe behaviour of position: relative; whereyou declaretop and left.
Whenyou employ a translationfunction, you’removing elements without impacting theflow of the
document.
Unlike position: relative, which allows you to positionanelement either against itscurrent positionor
against a parent or other ancestor, a translated element canonly be moved relativeto its current
position.
The translate(x,y) functionmovesanelement by x from the left, and y from the top:
31
6. CSS3 Transforms & Transitions
Examples
let’s say we want to move the word ―dukes‖ over to the right when the
user hovers over it,
#ourExampleh1:hover span {
color: #484848;
-webkit-transform: translateX(40px);
-moz-transform: translateX(40px);
-ms-transform: translateX(40px);
-o-transform:translateX(40px);
transform: translateX(40px);
}
32
6. CSS3 Transforms & Transitions
Scaling
The scale(x,y) functionscalesan element by the defined factorshorizontallyand vertically, espectively.
If only one value is provided, it will be used for both the x and y scaling.
#ourExample h1:hover span {
color: #484848;
-webkit-transform: translateX(40px)scale(1.5);
-moz-transform: translateX(40px)scale(1.5);
-ms-transform: translateX(40px)scale(1.5);
-o-transform:translateX(40px)scale(1.5);
transform: translateX(40px)scale(1.5);
}
Lets scalethe same example
33
6. CSS3 Transforms & Transitions
Rotation
The rotate() functionrotatesanelement around the point of origin(as with scale,bydefault this is the
element’s center), by a specified anglevalue. Generally, angles aredeclared in degrees, with positive
degreesmoving clockwiseand negativemoving counter-clockwise.
#ourExample h1:hover span {
color: #484848;
-webkit-transform:rotate(10deg)translateX(40px) scale(1.5);
-moz-transform:rotate(10deg)translateX(40px) scale(1.5);
-ms-transform:rotate(10deg)translateX(40px) scale(1.5);
-o-transform:rotate(10deg)translateX(40px) scale(1.5);
transform:rotate(10deg)translateX(40px) scale(1.5);
}
Lets scalethe same example
34
6. CSS3 Transforms & Transitions
Skew
The skew(x,y) functionspecifiesa skew along the X and Y axes. As you’d expect, thex specifiesthe
skew on the X axis, and the y specifiesthe skew on theY axis.
If the second parameter isomitted, theskew will only occur on theX axis:
35
6. CSS3 Transforms & Transitions
Transitions
Transitionsallow the values of CSS propertiesto changeover time, essentially providing simple
animations. For example, ifa link changescolor on hover, you can have it graduallyfadefrom one color
to the other, instead of a sudden change
Here are the stepsto createa simpletransitionusing only CSS:
1. Declare the originalstateofthe element in the default style declaration.
2. Declarethe final stateof your transitioned element; for example, in a hover state.
3. Include the transitionfunctionsinyour default style declaration, using a few different properties:
transition-property, transition-duration,transition-timing-function, and transition-delay.
list of propertiesthat canbetransitioned
■ background-color and background-position ■ border-color, border-spacing, and border-width
■ bottom, top, left, and right ■ clip ■ color ■ crop ■ font-size and font-weight ■ height and width
■ letter-spacing■ line-height ■ margin ■ max-height, max-width, min-height, and min-width
■ opacity■ outline-color, outline-offset, and outline-width ■ padding ■ text-indent ■ text-shadow
■ vertical-align ■ visibility■ word-spacing ■ z-index
36
6. CSS3 Transforms & Transitions
Transition-duration
The transition-durationpropertysetshow long the transitionwilltake. You canspecifythis either in
seconds (s) or milliseconds(ms). We’d like our animationtobefairlyquick, so we’ll specify 0.2 seconds,
or 200 milliseconds:
37
6. CSS3 Transforms & Transitions
Transition-timing-function
The transition-timing-functionletsyou controlthe paceof the transitionineven moregranular detail.
Do you want your animationtostart offslow and get faster, start off fast and end slowe
You canspecifyone of the key termsease, linear, ease-in, ease-out, or easein-out.
The best way to familiarizeyourselfwith them is to play around and try them all.
38
6. CSS3 Transforms & Transitions
Transition-delay
Finally, by using thetransition-delayproperty, it’salsopossible to introducea delaybefore the
animationbegins. Normally, a transitionbeginsimmediately, so thedefault is 0. Include the number of
milliseconds(ms) or seconds (s) to delay the transition:
39
6. CSS3 Transforms & Transitions
Transition-shorthand property
With four transitionpropertiesand threevendor prefixes, you could wind up with 16 lines of CSS for a
single transition. Fortunately, aswith other properties, there’sa shorthand available. Thetransition
propertyis shorthand for the four transitionfunctionsdescribed above. Let’stake another look at our
transitionsofar:
shorthand
Notethat order of the values is important and must beas follows (though you don’t need to specifyall
four values):
1. transition-property
2. transition-duration
3. transition-function
4. transition-delay
40
6. CSS3 Transforms & Transitions
Multiple transition
With four transitionpropertiesand threevendor prefixes, you could wind up with 16 lines of CSS for a
single transition. Fortunately, aswith other properties, there’sa shorthand available. Thetransition
propertyis shorthand for the four transitionfunctionsdescribed above. Let’stake another look at our
transitionsofar:
41
6. CSS3 Animation
Transitionsanimateelementsover time; however, they’re limited in what they cando.
You candefine starting and ending states, but there’s no fine-grained controlover any intermediate
states. CSS animations, unliketransitions, allow you to controleach step of an animationvia
keyframes. If you’ve ever worked with Flash, you’re likely very familiar with theconcept ofkeyframes;
if not, don’t worry, it’sfairly straightforward.
A keyframeis a snapshot that definesa starting or end point of any smooth transition.
With CSS transitions, we’reessentiallylimited to defining thefirst and last keyframes. CSS animations
allow us to add any number of keyframesin between, to guideour animationinmorecomplex ways.
Animation properties:
animation-name
animation-duration
animation-timing-function
animation-iteration-count
animation-direction
animation-delay
animation-fill-mode
42
6. CSS3 Animation
To animateanelement in CSS, you first createa named animation, thenattach it toanelement in that
element’s propertydeclarationblock. Animationsinthemselvesdon’t do anything; inorder to animate
an element, you will need to associatetheanimationwith that element.
To createananimation, usethe@keyframes
The last animationisworth paying extra attentionto:
we’ve applied thesame styles
to 0% and 100%, and to 20% and 80%. In thiscase, it
meansthe element will start
out invisible(opacity: 0;), fadein to visible by 20% of the
way through theduration,
remainvisibleuntil 80%, then fadeout.
We’ve created threeanimations, but theyaren’t attached
to any elements. Once we have defined an animation, the
next step is to apply it to one or more elementsusing
the variousanimationproperties.
43
6. CSS3 Animation
Shorthand
The animationpropertytakesasitsvalue a space-separated list of values for the longhand animation
name, animation-duration, animation-timing-function, animation-delay, animation-iteration-count,
animation-direction, and animation-fill-modeproperties:
44
6. CSS3 multiple columns
Newspaper-stylecolumnshavebeen close to impossibletoaccomplish with CSS
and HTML without forcing columnbreaksat fixed positions
With CSS3columns, the browser determineswhento end one columnand beginthe next without
requiring anyextra markup. You retaintheflexibilitytochangethenumber of columns as well as their
width, without having togo backin and alter the page’smarkup.
The column-count-property
The column-count propertyspecifiesthenumber of columnsdesired, and themaximum number of
columnsallowed. The default value of auto meansthat the element has one column.
Ex: #primaryarticle.content {
-webkit-column-count: 3;
-moz-column-count: 3;
column-count: 3;
}
45
6. CSS3 multiple columns
The column-gap-property
The column-gap propertyspecifiesthewidth ofthe spacebetween columns:
Ex: #primaryarticle.content {
-webkit-column-gap: 10px;
-moz-column-gap: 10px;
column-gap: 10px;
}
The column-width-property
The column-width propertyislike having a min-width for your columns. The browser will includeas
manycolumns of at least the given width as it can to fill up the element
For example, if we have a parent that is 400 pixelswide, a 10-pixelcolumn gap, and the column-width is
declared as150px, the browser can fit two columns:(400px width –10px columngap) ÷ 150px width
2.6 The browser rounds down to two columns, making columnsthat areas largeas possible in the
allotted space; in thiscase that’s195px for each column—thetotalwidth minusthe gap, divided by the
number of columns. Even if the column-count wereset to 3, therewould still only be two columns, as
there’s not enough spaceto includethree columnsof the specified width. In other words, you canthink
Of the column-count propertyasspecifying the maximumcolumncount.
Ex: #primaryarticle.content {
-webkit-column-width:150px;
-moz-column-width: 150px;
46
6. CSS3 multiple columns
The column-rule-property
Column rules areessentially bordersbetweeneach column. The column-rulepropertyspecifiesthe
color, style, and width of the column rules. The rule will appear inthe middleof the columngap
Ex: #primaryarticle.content {
-webkit-column-rule: 1px solid #ccc;
-moz-column-rule: 1px solid #ccc;
column-gap: 1px solid #ccc;
}
47
6. CSS3 selectors
Selectorsareat the heart of CSS. Without selectorsto target elementson the page,
the only way to modifythe CSS propertiesof an element would be to use the element’s
style attributeand declarethestyles inline. This, of course, is ugly, awkward,
and unmaintainable. Sowe use selectors.
Relational selectors
Descendant (E F)
You should definitelybe familiar with thisone. The descendant selector targetsanyelement F that is a
descendant (child, grandchild, great grandchild, and so on) of an element E.
Child (E > F)
Thisselector matchesanyelement F that is a direct child of element E—any further nested elements will
be ignored. Continuing theaboveexample, ol > li would only target li elements directlyinsidethe ol, and
would omit those nested inside a ul.
Adjacent Sibling(E+ F)
Thiswill match anyelement F that sharesthe same parent asE, and comes directly after E in the
markup. For example, li + li will target all li elements except thefirst li in a givencontainer.
GeneralSibling (E ~ F)
Thisone’s a littletrickier. It will match anyelement F that sharesthe sameparent asany E and comes
48
6. CSS3 selectors
Attribute selectors
E[attr$=val] (IE8+, WebKit, Opera, Mozilla)
Matchesanyelement E whose attributeattrendsin val. In other words, the val matchestheend of the
attributevalue.
E[attr*=val] (IE8+, WebKit, Opera, Mozilla)
Matchesanyelement E whose attributeattrmatchesvalanywhere withintheattribute. In other words,
the string val is matched anywhereinthe attributevalue. It is similar toE[attr~=val] above, except the
val can be part of a word.
Using thesame exampleasabove, .fakelink[title~=info] {} would match anyelement with the class
fakelink that hasa titleattributecontaining thestring info, such as "Clickhere for moreinformation."
49
6. CSS3 selectors
Pseudo-classes
:enabled
A user interface element that’s enabled.
:disabled
Conversely, a user interface element that’s disabled.
:checked
Radio buttons or checkboxes that are selected or ticked.
:valid
Applies to elements that are valid, based on the type or pattern attributes
:invalid
Applies to empty required elements, and elements failing to match the requirements defined by the type or pattern attributes.
:in-range
Applies to elements with range limitations, where the value is within those limitations. This applies, for example, to number
and range input types with min and max attributes
:out-of-range
The opposite of :in-range: elements whose value is outside the limitations of their range.
:required
Applies to form controls that have the required attribute set.
:optional
Applies to all form controls that do not have the required attribute.
:read-only
Applies to elements whose contents are unable to be altered by the user. This is usually most elements other than form fields.
:read-write
50
6. CSS3 selectors
Structural Pseudo-classes
:root
The root element, which is always the html element.
E F:nth-child(n)
The element F that is the nth child of its parent E.
E F:nth-last-child(n)
The element F that is the nth child of its parent E, counting backwards from the last one. li:nth-last-child(1) would match the
last item in any list—this is the same as li:last-child (see below).
E:nth-of-type(n)
The element that is the nth element of its type in a given parent element.
E:nth-last-of-type(n)
Like nth-of-type(n), except counting backwards from the last element in a parent.
E:first-child
The element E that is the first child E of its parent. This is the same as :nthchild(1).
E:last-child
The element E that is the last child E of its parent, same as :nth-last-child(1).
E:first-of-type
Same as :nth-of-type(1).
E:last-of-type
Same as :nth-last-of-type(1).
E:only-child
An element that’s the only child of its parent.
E:only-of-type
An element that’s the only one of its type inside its parent element.
E:empty
51
7. CSS3 media queries
CSS2 added support for themedia="screen" wayof defining which stylesheet to use for which
representationof the data. CSS3addsa new feature to thisfunctionality, byadding media queries.
Basically, thismeans you canchangestylesheets based on for instancethewidth and height of the
viewport. In a broader sense, this meansas the spec puts it: “by using Media Queries, presentations
can be tailored to a specific range of output devices without changing the content itself.”
Below aretwo tests, for min-width and max-width,currentlyonly functional(and thus green) in
Safari 3, Opera, and Firefox 3.1 (Alpha). This is however the futureof web development, and could
makebuilding pagesthat areusablein both the mobileas the normalweb a lot easier.
52
7. CSS3 Gradients
Use CSS 3 to createsomenice subtlegradients; or very compelling gradients!CSS 3 Gradientsarenot
the simplest thingsby any means; thereare several values to account for when projectingyour
gradient and it only worsens when working with radialgradients.
background:-moz-linear-gradient(pos, #AAA B, #XXX Y);
or :-moz-radial-gradient(pos, #AAA B, #XXX Y);
pos = the positionof the first colour, giving directiontothegradient
#AAA = primarycolour
B = where the fadebegins(%)
#XXX = secondarycolour
Y = where the fade begins(%)
The -webkit-gradient() isbuilt slightlydifferently but works in the samemanner, creating a start
positionand then the colors from() and to();
53
6. CSS3 references
http://www.css3.info/preview/attribute-selectors/
http://leaverou.github.com/animatable/
54

Contenu connexe

Tendances

CSS3: Simply Responsive
CSS3: Simply ResponsiveCSS3: Simply Responsive
CSS3: Simply ResponsiveDenise Jacobs
 
CSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to RespondCSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to RespondDenise Jacobs
 
Colors In CSS3
Colors In CSS3Colors In CSS3
Colors In CSS3Lea Verou
 
CSS3 Media Queries
CSS3 Media QueriesCSS3 Media Queries
CSS3 Media QueriesRuss Weakley
 
HTML5 and SVG
HTML5 and SVGHTML5 and SVG
HTML5 and SVGyarcub
 
CSS - OOCSS, SMACSS and more
CSS - OOCSS, SMACSS and moreCSS - OOCSS, SMACSS and more
CSS - OOCSS, SMACSS and moreRuss Weakley
 
Presentation about html5 css3
Presentation about html5 css3Presentation about html5 css3
Presentation about html5 css3Gopi A
 
SVG - Scalable Vector Graphic
SVG - Scalable Vector GraphicSVG - Scalable Vector Graphic
SVG - Scalable Vector GraphicAkila Iroshan
 
Dive into HTML5: SVG and Canvas
Dive into HTML5: SVG and CanvasDive into HTML5: SVG and Canvas
Dive into HTML5: SVG and CanvasDoris Chen
 
CSS: a rapidly changing world
CSS: a rapidly changing worldCSS: a rapidly changing world
CSS: a rapidly changing worldRuss Weakley
 
Html & Css presentation
Html  & Css presentation Html  & Css presentation
Html & Css presentation joilrahat
 
SVG For Web Designers (and Developers)
SVG For Web Designers (and Developers) SVG For Web Designers (and Developers)
SVG For Web Designers (and Developers) Sara Soueidan
 

Tendances (20)

Intro to CSS3
Intro to CSS3Intro to CSS3
Intro to CSS3
 
CSS3: Simply Responsive
CSS3: Simply ResponsiveCSS3: Simply Responsive
CSS3: Simply Responsive
 
CSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to RespondCSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to Respond
 
CSS3 Introduction
CSS3 IntroductionCSS3 Introduction
CSS3 Introduction
 
Colors In CSS3
Colors In CSS3Colors In CSS3
Colors In CSS3
 
Css3 Presetation
Css3 PresetationCss3 Presetation
Css3 Presetation
 
Css3
Css3Css3
Css3
 
CSS3 Media Queries
CSS3 Media QueriesCSS3 Media Queries
CSS3 Media Queries
 
HTML5 and SVG
HTML5 and SVGHTML5 and SVG
HTML5 and SVG
 
CSS - OOCSS, SMACSS and more
CSS - OOCSS, SMACSS and moreCSS - OOCSS, SMACSS and more
CSS - OOCSS, SMACSS and more
 
Presentation about html5 css3
Presentation about html5 css3Presentation about html5 css3
Presentation about html5 css3
 
SVG - Scalable Vector Graphic
SVG - Scalable Vector GraphicSVG - Scalable Vector Graphic
SVG - Scalable Vector Graphic
 
Css 3
Css 3Css 3
Css 3
 
Css 3
Css 3Css 3
Css 3
 
Dive into HTML5: SVG and Canvas
Dive into HTML5: SVG and CanvasDive into HTML5: SVG and Canvas
Dive into HTML5: SVG and Canvas
 
CSS: a rapidly changing world
CSS: a rapidly changing worldCSS: a rapidly changing world
CSS: a rapidly changing world
 
Html & Css presentation
Html  & Css presentation Html  & Css presentation
Html & Css presentation
 
Svg
SvgSvg
Svg
 
SVG For Web Designers (and Developers)
SVG For Web Designers (and Developers) SVG For Web Designers (and Developers)
SVG For Web Designers (and Developers)
 
CSS
CSS CSS
CSS
 

Similaire à Css3

CSS3: The Next Generation Of Style
CSS3: The Next Generation Of StyleCSS3: The Next Generation Of Style
CSS3: The Next Generation Of StylejbellWCT
 
CSS3 Transitions
CSS3 TransitionsCSS3 Transitions
CSS3 Transitionshstryk
 
CSS3 : Animation ,Transitions, Gradients
CSS3 : Animation ,Transitions, GradientsCSS3 : Animation ,Transitions, Gradients
CSS3 : Animation ,Transitions, GradientsJatin_23
 
Designing Your Next Generation Web Pages with CSS3
Designing Your Next Generation Web Pages with CSS3Designing Your Next Generation Web Pages with CSS3
Designing Your Next Generation Web Pages with CSS3Gil Fink
 
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 cssDhairya Joshi
 
Css3 transitions and animations + graceful degradation with jQuery
Css3 transitions and animations + graceful degradation with jQueryCss3 transitions and animations + graceful degradation with jQuery
Css3 transitions and animations + graceful degradation with jQueryAndrea Verlicchi
 
CSS3 basics for beginners - Imrokraft
CSS3 basics for beginners - ImrokraftCSS3 basics for beginners - Imrokraft
CSS3 basics for beginners - Imrokraftimrokraft
 
Class 4 handout w css3 using j fiddle
Class 4 handout w css3 using j fiddleClass 4 handout w css3 using j fiddle
Class 4 handout w css3 using j fiddleErin M. Kidwell
 
CSS3: Ready for Primetime?
CSS3: Ready for Primetime?CSS3: Ready for Primetime?
CSS3: Ready for Primetime?Jeff Bridgforth
 
Css methods architecture
Css methods architectureCss methods architecture
Css methods architectureLasha Sumbadze
 
Workshop 18: CSS Animations & cool effects
Workshop 18: CSS Animations & cool effectsWorkshop 18: CSS Animations & cool effects
Workshop 18: CSS Animations & cool effectsVisual Engineering
 
A brief look at CSS3 techniques by Aaron Rodgers, Web Designer @ vzaar.com
A brief look at CSS3 techniques by Aaron Rodgers, Web Designer @ vzaar.comA brief look at CSS3 techniques by Aaron Rodgers, Web Designer @ vzaar.com
A brief look at CSS3 techniques by Aaron Rodgers, Web Designer @ vzaar.comapplicake
 
HTML5, CSS3, and other fancy buzzwords
HTML5, CSS3, and other fancy buzzwordsHTML5, CSS3, and other fancy buzzwords
HTML5, CSS3, and other fancy buzzwordsMo Jangda
 
Cordova training - Day 2 Introduction to CSS 3
Cordova training - Day 2 Introduction to CSS 3Cordova training - Day 2 Introduction to CSS 3
Cordova training - Day 2 Introduction to CSS 3Binu Paul
 
Web Design Trends 2010 - What Is CSS3 All About?
Web Design Trends 2010 - What Is CSS3 All About?Web Design Trends 2010 - What Is CSS3 All About?
Web Design Trends 2010 - What Is CSS3 All About?Alexandra Lo Cascio
 

Similaire à Css3 (20)

CSS3: The Next Generation Of Style
CSS3: The Next Generation Of StyleCSS3: The Next Generation Of Style
CSS3: The Next Generation Of Style
 
CSS3 Transitions
CSS3 TransitionsCSS3 Transitions
CSS3 Transitions
 
CSS3 : Animation ,Transitions, Gradients
CSS3 : Animation ,Transitions, GradientsCSS3 : Animation ,Transitions, Gradients
CSS3 : Animation ,Transitions, Gradients
 
Designing Your Next Generation Web Pages with CSS3
Designing Your Next Generation Web Pages with CSS3Designing Your Next Generation Web Pages with CSS3
Designing Your Next Generation Web Pages with CSS3
 
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
 
Css3 transitions and animations + graceful degradation with jQuery
Css3 transitions and animations + graceful degradation with jQueryCss3 transitions and animations + graceful degradation with jQuery
Css3 transitions and animations + graceful degradation with jQuery
 
CSS3 basics for beginners - Imrokraft
CSS3 basics for beginners - ImrokraftCSS3 basics for beginners - Imrokraft
CSS3 basics for beginners - Imrokraft
 
Class 4 handout w css3 using j fiddle
Class 4 handout w css3 using j fiddleClass 4 handout w css3 using j fiddle
Class 4 handout w css3 using j fiddle
 
html5_css3
html5_css3html5_css3
html5_css3
 
Css3 101
Css3 101Css3 101
Css3 101
 
Css3
Css3Css3
Css3
 
CSS3: Ready for Primetime?
CSS3: Ready for Primetime?CSS3: Ready for Primetime?
CSS3: Ready for Primetime?
 
Css methods architecture
Css methods architectureCss methods architecture
Css methods architecture
 
Workshop 18: CSS Animations & cool effects
Workshop 18: CSS Animations & cool effectsWorkshop 18: CSS Animations & cool effects
Workshop 18: CSS Animations & cool effects
 
slides-students-C04.pdf
slides-students-C04.pdfslides-students-C04.pdf
slides-students-C04.pdf
 
A brief look at CSS3 techniques by Aaron Rodgers, Web Designer @ vzaar.com
A brief look at CSS3 techniques by Aaron Rodgers, Web Designer @ vzaar.comA brief look at CSS3 techniques by Aaron Rodgers, Web Designer @ vzaar.com
A brief look at CSS3 techniques by Aaron Rodgers, Web Designer @ vzaar.com
 
HTML5, CSS3, and other fancy buzzwords
HTML5, CSS3, and other fancy buzzwordsHTML5, CSS3, and other fancy buzzwords
HTML5, CSS3, and other fancy buzzwords
 
Cordova training - Day 2 Introduction to CSS 3
Cordova training - Day 2 Introduction to CSS 3Cordova training - Day 2 Introduction to CSS 3
Cordova training - Day 2 Introduction to CSS 3
 
Web Design Trends 2010 - What Is CSS3 All About?
Web Design Trends 2010 - What Is CSS3 All About?Web Design Trends 2010 - What Is CSS3 All About?
Web Design Trends 2010 - What Is CSS3 All About?
 
SVGD3Angular2React
SVGD3Angular2ReactSVGD3Angular2React
SVGD3Angular2React
 

Plus de Rahma Boufalgha

Plus de Rahma Boufalgha (6)

BTS BLANC.pdf
BTS BLANC.pdfBTS BLANC.pdf
BTS BLANC.pdf
 
Java 110605092007-phpapp02
Java 110605092007-phpapp02Java 110605092007-phpapp02
Java 110605092007-phpapp02
 
Java 110605092007-phpapp02
Java 110605092007-phpapp02Java 110605092007-phpapp02
Java 110605092007-phpapp02
 
Memojava 100604104941-phpapp02
Memojava 100604104941-phpapp02Memojava 100604104941-phpapp02
Memojava 100604104941-phpapp02
 
Create newpdf
Create newpdfCreate newpdf
Create newpdf
 
Html 5(1)
Html 5(1)Html 5(1)
Html 5(1)
 

Dernier

fmovies-Movies hold a special place in the hearts
fmovies-Movies hold a special place in the heartsfmovies-Movies hold a special place in the hearts
fmovies-Movies hold a special place in the heartsa18205752
 
Housewife Call Girls Sonagachi - 8250192130 Booking and charges genuine rate ...
Housewife Call Girls Sonagachi - 8250192130 Booking and charges genuine rate ...Housewife Call Girls Sonagachi - 8250192130 Booking and charges genuine rate ...
Housewife Call Girls Sonagachi - 8250192130 Booking and charges genuine rate ...Riya Pathan
 
Private Call Girls Bansdroni - 8250192130 | 24x7 Service Available Near Me
Private Call Girls Bansdroni - 8250192130 | 24x7 Service Available Near MePrivate Call Girls Bansdroni - 8250192130 | 24x7 Service Available Near Me
Private Call Girls Bansdroni - 8250192130 | 24x7 Service Available Near MeRiya Pathan
 
NO1 WorldWide Amil baba in pakistan Amil Baba in Karachi Black Magic Islamaba...
NO1 WorldWide Amil baba in pakistan Amil Baba in Karachi Black Magic Islamaba...NO1 WorldWide Amil baba in pakistan Amil Baba in Karachi Black Magic Islamaba...
NO1 WorldWide Amil baba in pakistan Amil Baba in Karachi Black Magic Islamaba...Amil baba
 
The Fine Line Between Honest and Evil Comics by Salty Vixen
The Fine Line Between Honest and Evil Comics by Salty VixenThe Fine Line Between Honest and Evil Comics by Salty Vixen
The Fine Line Between Honest and Evil Comics by Salty VixenSalty Vixen Stories & More
 
VIP Call Girls In Goa 7028418221 Call Girls In Baga Beach Escorts Service
VIP Call Girls In Goa 7028418221 Call Girls In Baga Beach Escorts ServiceVIP Call Girls In Goa 7028418221 Call Girls In Baga Beach Escorts Service
VIP Call Girls In Goa 7028418221 Call Girls In Baga Beach Escorts ServiceApsara Of India
 
Vip Udaipur Call Girls 9602870969 Dabok Airport Udaipur Escorts Service
Vip Udaipur Call Girls 9602870969 Dabok Airport Udaipur Escorts ServiceVip Udaipur Call Girls 9602870969 Dabok Airport Udaipur Escorts Service
Vip Udaipur Call Girls 9602870969 Dabok Airport Udaipur Escorts ServiceApsara Of India
 
Call Girls in Najafgarh Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Najafgarh Delhi 💯Call Us 🔝8264348440🔝Call Girls in Najafgarh Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Najafgarh Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Call Girls in Faridabad 9000000000 Faridabad Escorts Service
Call Girls in Faridabad 9000000000 Faridabad Escorts ServiceCall Girls in Faridabad 9000000000 Faridabad Escorts Service
Call Girls in Faridabad 9000000000 Faridabad Escorts ServiceTina Ji
 
Hifi Laxmi Nagar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ D...
Hifi Laxmi Nagar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ D...Hifi Laxmi Nagar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ D...
Hifi Laxmi Nagar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ D...srsj9000
 
Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...
Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...
Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...First NO1 World Amil baba in Faisalabad
 
5* Hotel Call Girls In Goa 7028418221 Call Girls In Calangute Beach Escort Se...
5* Hotel Call Girls In Goa 7028418221 Call Girls In Calangute Beach Escort Se...5* Hotel Call Girls In Goa 7028418221 Call Girls In Calangute Beach Escort Se...
5* Hotel Call Girls In Goa 7028418221 Call Girls In Calangute Beach Escort Se...Apsara Of India
 
Call Girls Ellis Bridge 7397865700 Independent Call Girls
Call Girls Ellis Bridge 7397865700 Independent Call GirlsCall Girls Ellis Bridge 7397865700 Independent Call Girls
Call Girls Ellis Bridge 7397865700 Independent Call Girlsssuser7cb4ff
 
Cash Payment Contact:- 7028418221 Goa Call Girls Service North Goa Escorts
Cash Payment Contact:- 7028418221 Goa Call Girls Service North Goa EscortsCash Payment Contact:- 7028418221 Goa Call Girls Service North Goa Escorts
Cash Payment Contact:- 7028418221 Goa Call Girls Service North Goa EscortsApsara Of India
 
Real NO1 Amil baba in Faisalabad Kala jadu in faisalabad Aamil baba Faisalaba...
Real NO1 Amil baba in Faisalabad Kala jadu in faisalabad Aamil baba Faisalaba...Real NO1 Amil baba in Faisalabad Kala jadu in faisalabad Aamil baba Faisalaba...
Real NO1 Amil baba in Faisalabad Kala jadu in faisalabad Aamil baba Faisalaba...Amil Baba Company
 
Call US '' 8377087607'' !! Call Girls In Model Town Metro (Delhi NCR)
Call US '' 8377087607'' !! Call Girls In Model Town Metro (Delhi NCR)Call US '' 8377087607'' !! Call Girls In Model Town Metro (Delhi NCR)
Call US '' 8377087607'' !! Call Girls In Model Town Metro (Delhi NCR)dollysharma2066
 
Kolkata Call Girl Howrah 👉 8250192130 ❣️💯 Available With Room 24×7
Kolkata Call Girl Howrah 👉 8250192130 ❣️💯 Available With Room 24×7Kolkata Call Girl Howrah 👉 8250192130 ❣️💯 Available With Room 24×7
Kolkata Call Girl Howrah 👉 8250192130 ❣️💯 Available With Room 24×7Riya Pathan
 
LE IMPOSSIBRU QUIZ (Based on Splapp-me-do)
LE IMPOSSIBRU QUIZ (Based on Splapp-me-do)LE IMPOSSIBRU QUIZ (Based on Splapp-me-do)
LE IMPOSSIBRU QUIZ (Based on Splapp-me-do)bertfelixtorre
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377087607
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377087607FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377087607
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377087607dollysharma2066
 
5* Hotel Call Girls In Goa 7028418221 Call Girls In North Goa Escort Services
5* Hotel Call Girls In Goa 7028418221 Call Girls In North Goa Escort Services5* Hotel Call Girls In Goa 7028418221 Call Girls In North Goa Escort Services
5* Hotel Call Girls In Goa 7028418221 Call Girls In North Goa Escort ServicesApsara Of India
 

Dernier (20)

fmovies-Movies hold a special place in the hearts
fmovies-Movies hold a special place in the heartsfmovies-Movies hold a special place in the hearts
fmovies-Movies hold a special place in the hearts
 
Housewife Call Girls Sonagachi - 8250192130 Booking and charges genuine rate ...
Housewife Call Girls Sonagachi - 8250192130 Booking and charges genuine rate ...Housewife Call Girls Sonagachi - 8250192130 Booking and charges genuine rate ...
Housewife Call Girls Sonagachi - 8250192130 Booking and charges genuine rate ...
 
Private Call Girls Bansdroni - 8250192130 | 24x7 Service Available Near Me
Private Call Girls Bansdroni - 8250192130 | 24x7 Service Available Near MePrivate Call Girls Bansdroni - 8250192130 | 24x7 Service Available Near Me
Private Call Girls Bansdroni - 8250192130 | 24x7 Service Available Near Me
 
NO1 WorldWide Amil baba in pakistan Amil Baba in Karachi Black Magic Islamaba...
NO1 WorldWide Amil baba in pakistan Amil Baba in Karachi Black Magic Islamaba...NO1 WorldWide Amil baba in pakistan Amil Baba in Karachi Black Magic Islamaba...
NO1 WorldWide Amil baba in pakistan Amil Baba in Karachi Black Magic Islamaba...
 
The Fine Line Between Honest and Evil Comics by Salty Vixen
The Fine Line Between Honest and Evil Comics by Salty VixenThe Fine Line Between Honest and Evil Comics by Salty Vixen
The Fine Line Between Honest and Evil Comics by Salty Vixen
 
VIP Call Girls In Goa 7028418221 Call Girls In Baga Beach Escorts Service
VIP Call Girls In Goa 7028418221 Call Girls In Baga Beach Escorts ServiceVIP Call Girls In Goa 7028418221 Call Girls In Baga Beach Escorts Service
VIP Call Girls In Goa 7028418221 Call Girls In Baga Beach Escorts Service
 
Vip Udaipur Call Girls 9602870969 Dabok Airport Udaipur Escorts Service
Vip Udaipur Call Girls 9602870969 Dabok Airport Udaipur Escorts ServiceVip Udaipur Call Girls 9602870969 Dabok Airport Udaipur Escorts Service
Vip Udaipur Call Girls 9602870969 Dabok Airport Udaipur Escorts Service
 
Call Girls in Najafgarh Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Najafgarh Delhi 💯Call Us 🔝8264348440🔝Call Girls in Najafgarh Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Najafgarh Delhi 💯Call Us 🔝8264348440🔝
 
Call Girls in Faridabad 9000000000 Faridabad Escorts Service
Call Girls in Faridabad 9000000000 Faridabad Escorts ServiceCall Girls in Faridabad 9000000000 Faridabad Escorts Service
Call Girls in Faridabad 9000000000 Faridabad Escorts Service
 
Hifi Laxmi Nagar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ D...
Hifi Laxmi Nagar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ D...Hifi Laxmi Nagar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ D...
Hifi Laxmi Nagar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ D...
 
Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...
Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...
Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...
 
5* Hotel Call Girls In Goa 7028418221 Call Girls In Calangute Beach Escort Se...
5* Hotel Call Girls In Goa 7028418221 Call Girls In Calangute Beach Escort Se...5* Hotel Call Girls In Goa 7028418221 Call Girls In Calangute Beach Escort Se...
5* Hotel Call Girls In Goa 7028418221 Call Girls In Calangute Beach Escort Se...
 
Call Girls Ellis Bridge 7397865700 Independent Call Girls
Call Girls Ellis Bridge 7397865700 Independent Call GirlsCall Girls Ellis Bridge 7397865700 Independent Call Girls
Call Girls Ellis Bridge 7397865700 Independent Call Girls
 
Cash Payment Contact:- 7028418221 Goa Call Girls Service North Goa Escorts
Cash Payment Contact:- 7028418221 Goa Call Girls Service North Goa EscortsCash Payment Contact:- 7028418221 Goa Call Girls Service North Goa Escorts
Cash Payment Contact:- 7028418221 Goa Call Girls Service North Goa Escorts
 
Real NO1 Amil baba in Faisalabad Kala jadu in faisalabad Aamil baba Faisalaba...
Real NO1 Amil baba in Faisalabad Kala jadu in faisalabad Aamil baba Faisalaba...Real NO1 Amil baba in Faisalabad Kala jadu in faisalabad Aamil baba Faisalaba...
Real NO1 Amil baba in Faisalabad Kala jadu in faisalabad Aamil baba Faisalaba...
 
Call US '' 8377087607'' !! Call Girls In Model Town Metro (Delhi NCR)
Call US '' 8377087607'' !! Call Girls In Model Town Metro (Delhi NCR)Call US '' 8377087607'' !! Call Girls In Model Town Metro (Delhi NCR)
Call US '' 8377087607'' !! Call Girls In Model Town Metro (Delhi NCR)
 
Kolkata Call Girl Howrah 👉 8250192130 ❣️💯 Available With Room 24×7
Kolkata Call Girl Howrah 👉 8250192130 ❣️💯 Available With Room 24×7Kolkata Call Girl Howrah 👉 8250192130 ❣️💯 Available With Room 24×7
Kolkata Call Girl Howrah 👉 8250192130 ❣️💯 Available With Room 24×7
 
LE IMPOSSIBRU QUIZ (Based on Splapp-me-do)
LE IMPOSSIBRU QUIZ (Based on Splapp-me-do)LE IMPOSSIBRU QUIZ (Based on Splapp-me-do)
LE IMPOSSIBRU QUIZ (Based on Splapp-me-do)
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377087607
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377087607FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377087607
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377087607
 
5* Hotel Call Girls In Goa 7028418221 Call Girls In North Goa Escort Services
5* Hotel Call Girls In Goa 7028418221 Call Girls In North Goa Escort Services5* Hotel Call Girls In Goa 7028418221 Call Girls In North Goa Escort Services
5* Hotel Call Girls In Goa 7028418221 Call Girls In North Goa Escort Services
 

Css3

  • 1. UpWeb Esprit 2014/2015 GETTING STARTED WITH CSS3
  • 2. Agenda  Introduction to CSS3  CSS3 Borders  CSS3 Backgrounds  CSS3 Text Effects  CSS3 Fonts  CSS3 2D Transforms  CSS3 3D Transforms  CSS3 Transitions  CSS3 Animations  CSS3 Multiple columns  CSS3 selectors 2
  • 3. 1. Introduction to CSS3 1.1 What Is CSS3 and why we need to use it?  Successor of CSS2  It comes with new modules  Below is a non exhaustive list of features that tend to be labelled as ―css3" in the medias:  Someof the most important CSS3modulesare:  Selectors  Box Model  Backgroundsand Borders  Text Effects  2D/3D Transformations  Animations  MultipleColumn Layout  User Interface 3
  • 4. 2. CSS3 Borders With CSS3, you cancreaterounded borders, add shadow to boxes, and use an imageasa border - without using a designprogram, like Photoshop 4
  • 16. 3. CSS3 Background we will be taking a look at the new background properties. Theseincludebackground size, using more thanone background for an element, and background origin(which effectsthepositionof a background). The new featuresallow greater controlof the background element and will provide designerswith a whole arrayof new possibilities. Multiple Backgrounds The new abilitytouse multiplebackgroundsisa great timesaver, allowing you to achieveeffects which previously required morethanone div. Whether it will be possibleto combinethiswith background-sizewill be interesting tosee. The examplebelow uses one background for the top border, one repeated verticallyfor theleft and right bordersand a third at the bottom. 16
  • 17. 4. CSS3 Text effects In thistutorialwewill learn how to use CSS Styles to givestylish effects to text. Learn how to createshadow effects, inset effects, neon style effects, glossy styles, grungestyle effects and more! 17
  • 18. 4. CSS3 Text effects 18
  • 19. 4. CSS3 Text effects 19
  • 20. 4. CSS3 Text effects 20
  • 21. 3. CSS3 Text effects 21
  • 22. 4. CSS3 fontsSteps to Use the fonts We'll follow these steps to applythe fonts to your webpage. → Download Fonts → Convert themOnline → Use the StylesheetCode → Use Anywhere → Download Fonts Thereare manywebsitewhere you can download fonts for free. Here are few websitewith a hugecollection of free as well as paid fonts. › dafont.com, urbanfonts.com,1001freefonts.com ‹ Choose the font you like and download it. → Convert The Fonts The downloaded fonts will work on most of the browsersbut won't work on IE. To makethe fonts appear on IE we'll have to convert it to a format(eot) that IEunderstands. How to Convert Thereare manysoftware'savailable on the internet, most of them paid. Here's a websitewhere we canconvert the TTFfont to EOT font for IE for Free! › Online TTF To EOT converter ‹ Upload thefont you want to convert on thiswebsiteand thendownload the converted font. Noticethefont extensionbefore converting wasTTF after converting changestoEOT. Keep both these files in the same folderFonts. 22
  • 31. 6. CSS3 Transforms & Transitions Transforms CSS3 transform propertyletsyou translate, rotate, scale, or skew any element on thepage. Whilesome of these effectswere possible using previously existing CSS features (like relativeand absolutepositioning), CSS3givesyou unprecedented controlover many moreaspects of an element’s appearance. Translation Translationfunctionsallow you to move elements left, right, up, or down. These functionsaresimilar tothe behaviour of position: relative; whereyou declaretop and left. Whenyou employ a translationfunction, you’removing elements without impacting theflow of the document. Unlike position: relative, which allows you to positionanelement either against itscurrent positionor against a parent or other ancestor, a translated element canonly be moved relativeto its current position. The translate(x,y) functionmovesanelement by x from the left, and y from the top: 31
  • 32. 6. CSS3 Transforms & Transitions Examples let’s say we want to move the word ―dukes‖ over to the right when the user hovers over it, #ourExampleh1:hover span { color: #484848; -webkit-transform: translateX(40px); -moz-transform: translateX(40px); -ms-transform: translateX(40px); -o-transform:translateX(40px); transform: translateX(40px); } 32
  • 33. 6. CSS3 Transforms & Transitions Scaling The scale(x,y) functionscalesan element by the defined factorshorizontallyand vertically, espectively. If only one value is provided, it will be used for both the x and y scaling. #ourExample h1:hover span { color: #484848; -webkit-transform: translateX(40px)scale(1.5); -moz-transform: translateX(40px)scale(1.5); -ms-transform: translateX(40px)scale(1.5); -o-transform:translateX(40px)scale(1.5); transform: translateX(40px)scale(1.5); } Lets scalethe same example 33
  • 34. 6. CSS3 Transforms & Transitions Rotation The rotate() functionrotatesanelement around the point of origin(as with scale,bydefault this is the element’s center), by a specified anglevalue. Generally, angles aredeclared in degrees, with positive degreesmoving clockwiseand negativemoving counter-clockwise. #ourExample h1:hover span { color: #484848; -webkit-transform:rotate(10deg)translateX(40px) scale(1.5); -moz-transform:rotate(10deg)translateX(40px) scale(1.5); -ms-transform:rotate(10deg)translateX(40px) scale(1.5); -o-transform:rotate(10deg)translateX(40px) scale(1.5); transform:rotate(10deg)translateX(40px) scale(1.5); } Lets scalethe same example 34
  • 35. 6. CSS3 Transforms & Transitions Skew The skew(x,y) functionspecifiesa skew along the X and Y axes. As you’d expect, thex specifiesthe skew on the X axis, and the y specifiesthe skew on theY axis. If the second parameter isomitted, theskew will only occur on theX axis: 35
  • 36. 6. CSS3 Transforms & Transitions Transitions Transitionsallow the values of CSS propertiesto changeover time, essentially providing simple animations. For example, ifa link changescolor on hover, you can have it graduallyfadefrom one color to the other, instead of a sudden change Here are the stepsto createa simpletransitionusing only CSS: 1. Declare the originalstateofthe element in the default style declaration. 2. Declarethe final stateof your transitioned element; for example, in a hover state. 3. Include the transitionfunctionsinyour default style declaration, using a few different properties: transition-property, transition-duration,transition-timing-function, and transition-delay. list of propertiesthat canbetransitioned ■ background-color and background-position ■ border-color, border-spacing, and border-width ■ bottom, top, left, and right ■ clip ■ color ■ crop ■ font-size and font-weight ■ height and width ■ letter-spacing■ line-height ■ margin ■ max-height, max-width, min-height, and min-width ■ opacity■ outline-color, outline-offset, and outline-width ■ padding ■ text-indent ■ text-shadow ■ vertical-align ■ visibility■ word-spacing ■ z-index 36
  • 37. 6. CSS3 Transforms & Transitions Transition-duration The transition-durationpropertysetshow long the transitionwilltake. You canspecifythis either in seconds (s) or milliseconds(ms). We’d like our animationtobefairlyquick, so we’ll specify 0.2 seconds, or 200 milliseconds: 37
  • 38. 6. CSS3 Transforms & Transitions Transition-timing-function The transition-timing-functionletsyou controlthe paceof the transitionineven moregranular detail. Do you want your animationtostart offslow and get faster, start off fast and end slowe You canspecifyone of the key termsease, linear, ease-in, ease-out, or easein-out. The best way to familiarizeyourselfwith them is to play around and try them all. 38
  • 39. 6. CSS3 Transforms & Transitions Transition-delay Finally, by using thetransition-delayproperty, it’salsopossible to introducea delaybefore the animationbegins. Normally, a transitionbeginsimmediately, so thedefault is 0. Include the number of milliseconds(ms) or seconds (s) to delay the transition: 39
  • 40. 6. CSS3 Transforms & Transitions Transition-shorthand property With four transitionpropertiesand threevendor prefixes, you could wind up with 16 lines of CSS for a single transition. Fortunately, aswith other properties, there’sa shorthand available. Thetransition propertyis shorthand for the four transitionfunctionsdescribed above. Let’stake another look at our transitionsofar: shorthand Notethat order of the values is important and must beas follows (though you don’t need to specifyall four values): 1. transition-property 2. transition-duration 3. transition-function 4. transition-delay 40
  • 41. 6. CSS3 Transforms & Transitions Multiple transition With four transitionpropertiesand threevendor prefixes, you could wind up with 16 lines of CSS for a single transition. Fortunately, aswith other properties, there’sa shorthand available. Thetransition propertyis shorthand for the four transitionfunctionsdescribed above. Let’stake another look at our transitionsofar: 41
  • 42. 6. CSS3 Animation Transitionsanimateelementsover time; however, they’re limited in what they cando. You candefine starting and ending states, but there’s no fine-grained controlover any intermediate states. CSS animations, unliketransitions, allow you to controleach step of an animationvia keyframes. If you’ve ever worked with Flash, you’re likely very familiar with theconcept ofkeyframes; if not, don’t worry, it’sfairly straightforward. A keyframeis a snapshot that definesa starting or end point of any smooth transition. With CSS transitions, we’reessentiallylimited to defining thefirst and last keyframes. CSS animations allow us to add any number of keyframesin between, to guideour animationinmorecomplex ways. Animation properties: animation-name animation-duration animation-timing-function animation-iteration-count animation-direction animation-delay animation-fill-mode 42
  • 43. 6. CSS3 Animation To animateanelement in CSS, you first createa named animation, thenattach it toanelement in that element’s propertydeclarationblock. Animationsinthemselvesdon’t do anything; inorder to animate an element, you will need to associatetheanimationwith that element. To createananimation, usethe@keyframes The last animationisworth paying extra attentionto: we’ve applied thesame styles to 0% and 100%, and to 20% and 80%. In thiscase, it meansthe element will start out invisible(opacity: 0;), fadein to visible by 20% of the way through theduration, remainvisibleuntil 80%, then fadeout. We’ve created threeanimations, but theyaren’t attached to any elements. Once we have defined an animation, the next step is to apply it to one or more elementsusing the variousanimationproperties. 43
  • 44. 6. CSS3 Animation Shorthand The animationpropertytakesasitsvalue a space-separated list of values for the longhand animation name, animation-duration, animation-timing-function, animation-delay, animation-iteration-count, animation-direction, and animation-fill-modeproperties: 44
  • 45. 6. CSS3 multiple columns Newspaper-stylecolumnshavebeen close to impossibletoaccomplish with CSS and HTML without forcing columnbreaksat fixed positions With CSS3columns, the browser determineswhento end one columnand beginthe next without requiring anyextra markup. You retaintheflexibilitytochangethenumber of columns as well as their width, without having togo backin and alter the page’smarkup. The column-count-property The column-count propertyspecifiesthenumber of columnsdesired, and themaximum number of columnsallowed. The default value of auto meansthat the element has one column. Ex: #primaryarticle.content { -webkit-column-count: 3; -moz-column-count: 3; column-count: 3; } 45
  • 46. 6. CSS3 multiple columns The column-gap-property The column-gap propertyspecifiesthewidth ofthe spacebetween columns: Ex: #primaryarticle.content { -webkit-column-gap: 10px; -moz-column-gap: 10px; column-gap: 10px; } The column-width-property The column-width propertyislike having a min-width for your columns. The browser will includeas manycolumns of at least the given width as it can to fill up the element For example, if we have a parent that is 400 pixelswide, a 10-pixelcolumn gap, and the column-width is declared as150px, the browser can fit two columns:(400px width –10px columngap) ÷ 150px width 2.6 The browser rounds down to two columns, making columnsthat areas largeas possible in the allotted space; in thiscase that’s195px for each column—thetotalwidth minusthe gap, divided by the number of columns. Even if the column-count wereset to 3, therewould still only be two columns, as there’s not enough spaceto includethree columnsof the specified width. In other words, you canthink Of the column-count propertyasspecifying the maximumcolumncount. Ex: #primaryarticle.content { -webkit-column-width:150px; -moz-column-width: 150px; 46
  • 47. 6. CSS3 multiple columns The column-rule-property Column rules areessentially bordersbetweeneach column. The column-rulepropertyspecifiesthe color, style, and width of the column rules. The rule will appear inthe middleof the columngap Ex: #primaryarticle.content { -webkit-column-rule: 1px solid #ccc; -moz-column-rule: 1px solid #ccc; column-gap: 1px solid #ccc; } 47
  • 48. 6. CSS3 selectors Selectorsareat the heart of CSS. Without selectorsto target elementson the page, the only way to modifythe CSS propertiesof an element would be to use the element’s style attributeand declarethestyles inline. This, of course, is ugly, awkward, and unmaintainable. Sowe use selectors. Relational selectors Descendant (E F) You should definitelybe familiar with thisone. The descendant selector targetsanyelement F that is a descendant (child, grandchild, great grandchild, and so on) of an element E. Child (E > F) Thisselector matchesanyelement F that is a direct child of element E—any further nested elements will be ignored. Continuing theaboveexample, ol > li would only target li elements directlyinsidethe ol, and would omit those nested inside a ul. Adjacent Sibling(E+ F) Thiswill match anyelement F that sharesthe same parent asE, and comes directly after E in the markup. For example, li + li will target all li elements except thefirst li in a givencontainer. GeneralSibling (E ~ F) Thisone’s a littletrickier. It will match anyelement F that sharesthe sameparent asany E and comes 48
  • 49. 6. CSS3 selectors Attribute selectors E[attr$=val] (IE8+, WebKit, Opera, Mozilla) Matchesanyelement E whose attributeattrendsin val. In other words, the val matchestheend of the attributevalue. E[attr*=val] (IE8+, WebKit, Opera, Mozilla) Matchesanyelement E whose attributeattrmatchesvalanywhere withintheattribute. In other words, the string val is matched anywhereinthe attributevalue. It is similar toE[attr~=val] above, except the val can be part of a word. Using thesame exampleasabove, .fakelink[title~=info] {} would match anyelement with the class fakelink that hasa titleattributecontaining thestring info, such as "Clickhere for moreinformation." 49
  • 50. 6. CSS3 selectors Pseudo-classes :enabled A user interface element that’s enabled. :disabled Conversely, a user interface element that’s disabled. :checked Radio buttons or checkboxes that are selected or ticked. :valid Applies to elements that are valid, based on the type or pattern attributes :invalid Applies to empty required elements, and elements failing to match the requirements defined by the type or pattern attributes. :in-range Applies to elements with range limitations, where the value is within those limitations. This applies, for example, to number and range input types with min and max attributes :out-of-range The opposite of :in-range: elements whose value is outside the limitations of their range. :required Applies to form controls that have the required attribute set. :optional Applies to all form controls that do not have the required attribute. :read-only Applies to elements whose contents are unable to be altered by the user. This is usually most elements other than form fields. :read-write 50
  • 51. 6. CSS3 selectors Structural Pseudo-classes :root The root element, which is always the html element. E F:nth-child(n) The element F that is the nth child of its parent E. E F:nth-last-child(n) The element F that is the nth child of its parent E, counting backwards from the last one. li:nth-last-child(1) would match the last item in any list—this is the same as li:last-child (see below). E:nth-of-type(n) The element that is the nth element of its type in a given parent element. E:nth-last-of-type(n) Like nth-of-type(n), except counting backwards from the last element in a parent. E:first-child The element E that is the first child E of its parent. This is the same as :nthchild(1). E:last-child The element E that is the last child E of its parent, same as :nth-last-child(1). E:first-of-type Same as :nth-of-type(1). E:last-of-type Same as :nth-last-of-type(1). E:only-child An element that’s the only child of its parent. E:only-of-type An element that’s the only one of its type inside its parent element. E:empty 51
  • 52. 7. CSS3 media queries CSS2 added support for themedia="screen" wayof defining which stylesheet to use for which representationof the data. CSS3addsa new feature to thisfunctionality, byadding media queries. Basically, thismeans you canchangestylesheets based on for instancethewidth and height of the viewport. In a broader sense, this meansas the spec puts it: “by using Media Queries, presentations can be tailored to a specific range of output devices without changing the content itself.” Below aretwo tests, for min-width and max-width,currentlyonly functional(and thus green) in Safari 3, Opera, and Firefox 3.1 (Alpha). This is however the futureof web development, and could makebuilding pagesthat areusablein both the mobileas the normalweb a lot easier. 52
  • 53. 7. CSS3 Gradients Use CSS 3 to createsomenice subtlegradients; or very compelling gradients!CSS 3 Gradientsarenot the simplest thingsby any means; thereare several values to account for when projectingyour gradient and it only worsens when working with radialgradients. background:-moz-linear-gradient(pos, #AAA B, #XXX Y); or :-moz-radial-gradient(pos, #AAA B, #XXX Y); pos = the positionof the first colour, giving directiontothegradient #AAA = primarycolour B = where the fadebegins(%) #XXX = secondarycolour Y = where the fade begins(%) The -webkit-gradient() isbuilt slightlydifferently but works in the samemanner, creating a start positionand then the colors from() and to(); 53