SlideShare a Scribd company logo
1 of 91
Download to read offline
CSS3
COLORS
Before we talk about CSS3
colors, we need to review
     CSS2.1 colors.
CSS2.1
Colors
CSS2.1 allowed colors to be
defined using six different types
           of values.
1   Keywords
2   Six-digit hexadecimal notation
3   Three-digit hexadecimal notation
4   RGB numeric notation
5   RGB percentage notation
6   System colors
1. Keywords
CSS2.1 allowed 17 keywords:
aqua, black, blue, fuchsia, gray,
green, lime, maroon, navy, olive,
 orange, purple, red, silver, teal,
        white, and yellow.
Example keywords:



p   {   color:   aqua; }
p   {   color:   black; }
p   {   color:   blue; }
p   {   color:   fuchsia; }
p   {   color:   gray; }
p   {   color:   green; }
p   {   color:   lime; }
2. Six-digit
hexadecimal
  notation
Six-digit hexadecimal notation
           (#rrggbb):



   p { color: #AE03FF; }
3. Three-digit
hexadecimal
   notation
Three-digit hexadecimal
   notation allows authors to
 replace double ‘rr’, ‘gg’ or ‘bb’
values with single values (#rgb):


   p   {   color:   #663399; }
   p   {   color:   #639; }
   p   {   color:   #aaff55; }
   p   {   color:   #af5; }
The six-digit RGB notation
 (#rrggbb) can only by converted
into three-digit form (#rgb) if each
  the rr, gg, and bb values each
 use duplicate digits. Many six-
digit values cannot be converted.

                             Cannot convert
    p { color: #953d3d; }
    p { color: #34d209; }    Cannot convert
4. RGB numeric
    notation
RGB numeric notation
uses 'rgb(' followed by a comma-
 separated list of three integer
     values, followed by ‘)’.



   p {
   color: rgb(109, 22, 255); }
RGB numeric notation allows
values between 0 (black) and 255
    (white). No unit identifier is
              required.
5. RGB percentage
     notation
RGB percentage notation uses
   'rgb(' followed by a comma-
separated list of three percentage
      values, followed by ')'.

    p {
    color: rgb(0%,10%,100%); }
RGB percentage notation
  allows values between 0%
 (black) and 100% (white). All
values must include % symbol.
6. System colors
CSS2.1 allowed System colors
to be used to specify colors that
matched the operating system's
         graphic style.

   p { color: ButtonFace; }
Note:
 System Colors have been
 deprecated in favor of the
   CSS3 UI “appearance’
 property for specifying the
   complete look of user
interface related elements.
CSS3 Colors
With CSS3, we can now apply
   colours using eight new
          methods:
1   Extended color keywords
2   Opacity
3   RGBA numeric notation
4   RGBA percentage notation
5   HSL notation
6   HSLA notation
7   The ‘currentColor’ keyword
8   The ‘transparent’ keyword
1. Extended Color
    Keywords
While CSS2.1 allowed us to use
17 basic color keywords, CSS3
 allows us to use and additional
130 extended color keywords.
This is a total of 147 keywords.
Example color keywords:



p   {   color:   peru; }
p   {   color:   salmon; }
p   {   color:   thisle; }
p   {   color:   firebrick; }
p   {   color:   ghostwhite; }
p   {   color:   goldenrod; }
p   {   color:   honeydew; }
Quick tip:
Do you have trouble spelling the
       keyword gray/grey?
Well, CSS3 color keywords have
 got you covered. They include
    gray, grey, darkgrey and
            darkgray.
Browser          Supported
Firefox 3.6, 4   Yes
Safari 4, 5      Yes
Chrome 9, 10     Yes
Opera 10, 11     Yes
IE 6, 7, 8, 9    Yes
2. Opacity
Opacity allows us to dictate the
  opacity/transparency of
           elements.
Opacity values range from 0 (or
 0.0), which is fully transparent to
 1 (or 1.0) which is 100% opaque.


p { opacity: 0.3; }
The opacity value must be a
number, which is zero or more
   digits followed by a dot (.)
followed by one or more digits.
           For example:

             0.5
             .5
Be aware that this property will
set the opacity for the element
and all of it’s child elements.
Browser          Supported
Firefox 3.6, 4   Yes
Safari 4, 5      Yes
Chrome 9, 10     Yes
Opera 10, 11     Yes
IE 6, 7, 8       No
IE 9             Yes
3. RGBA numeric
    notation
With CSS3 we can add an alpha
 channel to RGB values. This
 allows us to set our colors to
    specific levels of opacity.
While the ‘opacity’ property
sets the opacity/transparency of
entire elements, RGBA is used
  to set the opacity of color
          values only.
RGBA numeric notation
      uses 'rgba(' followed by a
   comma-separated list of three
   integer values, followed by an
    alpha value followed by a ‘)’.


p { color: rgba(100, 66, 255, 1); }
The three integer values must be
   between 0 (black) and 255
   (white). No unit identifier is
     required. For example:

             255
              0
This alpha value must be a
number, which is zero or more
   digits followed by a dot (.)
followed by one or more digits.
           For example:

             0.5
             .5
An alpha value of 1 means
the color will be fully opaque
 (displayed as a solid color).
An alpha value of 0.5 will be
         half opaque.
You should always include a
    backup for browsers that do not
        support this property.


p
{
     color: rgb(100, 66, 255);
     color: rgba(100, 66, 255, 0.5);
}
Browser          Supported
Firefox 3.6, 4   Yes
Safari 4, 5      Yes
Chrome 9, 10     Yes
Opera 10, 11     Yes
IE 6, 7, 8       No
IE 9             Yes
4. RGBA percentage
     notation
RGBA percentage notation
     uses 'rgba(' followed by a
   comma-separated list of three
  percentage values, followed by
  an alpha value followed by a ‘)’.


p { color: rgba(10%, 6%, 20%, 1); }
The three percentage values
must be between 0% (black) and
  100% (white). All values must
include % symbol. For example:

           100%
            0%
This alpha value must be a
number, which is zero or more
   digits followed by a dot (.)
followed by one or more digits.
           For example:

             0.5
             .5
Browser          Supported
Firefox 3.6, 4   Yes
Safari 4, 5      Yes
Chrome 9, 10     Yes
Opera 10, 11     Yes
IE 6, 7, 8       No
IE 9             Yes
5. HSL notation
HSL notation allows us to define
 colors using hue, saturation
        and lightness.
HSL notation is written like this:




p { color: hsl(280,100%,50%); }
The first value is for Hue and
  must be a integer value between
             0 and 359.


p { color: hsl(280,100%,50%); }
The second value is for
  Saturation and must be defined
      as a percentage value.


p { color: hsl(280,100%,50%); }
The third value is Lightness
   and must also be defined as a
         percentage value.


p { color: hsl(280,100%,50%); }
These three HSL values must
    be separated by commas.
   Whitespace after the commas
            is optional.

p { color: hsl(280,100%,50%); }
You should always include a
    backup color that is not HSL for
           older browsers.


p
{
     color: rgb(85,0,128);
     color: hsl(280,100%,50%);
}
Browser          Supported
Firefox 3.6, 4   Yes
Safari 4, 5      Yes
Chrome 9, 10     Yes
Opera 10, 11     Yes
IE 6, 7, 8       No
IE 9             Yes
6. HSLA notation
Like RGBA, we can add an alpha
   channel to HSL values. This
   allows us to set our colors to
     specific levels of opacity.
First of all, we need to change the
             HSL to HSLA:



p { color: hsla(280,100%,50%); }
Then, we need to add a new
   value at the end of the three
    comma-separated values.


p { color: hsla(280,100%,50%,0.5); }
The opacity value must be a
number, which is zero or more
   digits followed by a dot (.)
followed by one or more digits.
           For example:

             0.5
             .5
You should always include a
    backup color that is not HSL or
      HSLA for older browsers.


p
{
     color: rgb(85,0,128);
     color: hsla(280,100%,50%,0.5);
}
Browser          Supported
Firefox 3.6, 4   Yes
Safari 4, 5      Yes
Chrome 9, 10     Yes
Opera 10, 11     Yes
IE 6, 7, 8       No
IE 9             Yes
Why use HSL
 or HSLA?
From the browsers point of view,
there is no difference between
   values defined in RGBA
           or HSLA.
Some designers find it easier
to choose and adjust colors
       using HSLA.
7. The ‘currentColor’
      keyword
CSS1 and CSS2 defined
the initial value of the ‘border-
   color’ property to be “the
value of the ‘color’ property” .
    However, there is no
  corresponding keyword.
We had no way of specifying a
    border-color to match the color.

p
{
     color: red;
     border-width: 1px;
     border-style: solid;
     border-color: “the value of the
     ‘color’ property”;
}
CSS3 allows us to the
    currentColor keyword for this:

p
{
     color: red;
     border-width: 1px;
     border-style: solid;
     border-color: currentColor;
}
Browser           Supported
Firefox 3.6, 4    Yes
Safari 4, 5       Yes
Chrome 8, 9, 10   Yes
Opera 11          Yes
IE 6, 7, 8        No
IE 9              Yes
8. The ‘transparent’
     keyword
CSS1 introduced the ‘transparent’
 value for the background-color
             property.
CSS2 allowed the ‘transparent’
value to be applied to the ‘border-
          color’ property.
CSS3 allows the ‘transparent’
   keyword to be applied to any
     properties that accepts
         a ‘color’ value.



p { color: transparent; }
Browser          Supported
Firefox 3.6, 4   Yes
Safari 4, 5      Yes
Chrome 9, 10     Yes
Opera 10, 11     Yes
IE 6, 7, 8       No
IE 9             Yes
Russ Weakley
Max Design

Site: maxdesign.com.au
Twitter: twitter.com/russmaxdesign
Slideshare: slideshare.net/maxdesign
Linkedin: linkedin.com/in/russweakley

More Related Content

Similar to CSS3 cores e transparencia

Css ejemplos y codigo 1
Css ejemplos y codigo 1Css ejemplos y codigo 1
Css ejemplos y codigo 1FREDY GÓMEZ
 
Chapter 13: Colors and Backgrounds
Chapter 13: Colors and BackgroundsChapter 13: Colors and Backgrounds
Chapter 13: Colors and BackgroundsSteve Guinan
 
CSS3: Border And Colors
CSS3: Border And ColorsCSS3: Border And Colors
CSS3: Border And ColorsReema
 
Colors In CSS3
Colors In CSS3Colors In CSS3
Colors In CSS3Lea Verou
 
Css3 Complete Reference
Css3 Complete ReferenceCss3 Complete Reference
Css3 Complete ReferenceEPAM Systems
 
Advanced css colors
Advanced css colorsAdvanced css colors
Advanced css colorsdeepbidis
 
Web Development 2 (HTML & CSS)
Web Development 2 (HTML & CSS)Web Development 2 (HTML & CSS)
Web Development 2 (HTML & CSS)ghayour abbas
 
css trasition explanation about our project
css trasition explanation about our projectcss trasition explanation about our project
css trasition explanation about our projectDivPatel17
 
Handout2 formatting tags
Handout2 formatting tagsHandout2 formatting tags
Handout2 formatting tagsNadine Guevarra
 
JS Fest 2019. Mauricio Palma. You can’t read this sentence - A11y automation
JS Fest 2019. Mauricio Palma. You can’t read this sentence - A11y automationJS Fest 2019. Mauricio Palma. You can’t read this sentence - A11y automation
JS Fest 2019. Mauricio Palma. You can’t read this sentence - A11y automationJSFestUA
 
Compass, Sass, and the Enlightened CSS Developer
Compass, Sass, and the Enlightened CSS DeveloperCompass, Sass, and the Enlightened CSS Developer
Compass, Sass, and the Enlightened CSS DeveloperWynn Netherland
 

Similar to CSS3 cores e transparencia (20)

Css3 color
Css3 colorCss3 color
Css3 color
 
Css3 color
Css3 colorCss3 color
Css3 color
 
Css ejemplos y codigo 1
Css ejemplos y codigo 1Css ejemplos y codigo 1
Css ejemplos y codigo 1
 
Chapter 13: Colors and Backgrounds
Chapter 13: Colors and BackgroundsChapter 13: Colors and Backgrounds
Chapter 13: Colors and Backgrounds
 
CSS 3
CSS 3CSS 3
CSS 3
 
CSS3: Border And Colors
CSS3: Border And ColorsCSS3: Border And Colors
CSS3: Border And Colors
 
Colour
ColourColour
Colour
 
Colors In CSS3
Colors In CSS3Colors In CSS3
Colors In CSS3
 
Css3 Complete Reference
Css3 Complete ReferenceCss3 Complete Reference
Css3 Complete Reference
 
Advanced css colors
Advanced css colorsAdvanced css colors
Advanced css colors
 
Css gradients
Css gradientsCss gradients
Css gradients
 
Web Development 2 (HTML & CSS)
Web Development 2 (HTML & CSS)Web Development 2 (HTML & CSS)
Web Development 2 (HTML & CSS)
 
CSS 3 Overview
CSS 3 OverviewCSS 3 Overview
CSS 3 Overview
 
CSS3
CSS3CSS3
CSS3
 
css trasition explanation about our project
css trasition explanation about our projectcss trasition explanation about our project
css trasition explanation about our project
 
Handout2 formatting tags
Handout2 formatting tagsHandout2 formatting tags
Handout2 formatting tags
 
JS Fest 2019. Mauricio Palma. You can’t read this sentence - A11y automation
JS Fest 2019. Mauricio Palma. You can’t read this sentence - A11y automationJS Fest 2019. Mauricio Palma. You can’t read this sentence - A11y automation
JS Fest 2019. Mauricio Palma. You can’t read this sentence - A11y automation
 
Compass, Sass, and the Enlightened CSS Developer
Compass, Sass, and the Enlightened CSS DeveloperCompass, Sass, and the Enlightened CSS Developer
Compass, Sass, and the Enlightened CSS Developer
 
Css
CssCss
Css
 
Web - CSS 1.pptx
Web - CSS 1.pptxWeb - CSS 1.pptx
Web - CSS 1.pptx
 

Recently uploaded

Editorial design Magazine design project.pdf
Editorial design Magazine design project.pdfEditorial design Magazine design project.pdf
Editorial design Magazine design project.pdftbatkhuu1
 
Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...amitlee9823
 
Case Study of Hotel Taj Vivanta, Pune
Case Study of Hotel Taj Vivanta, PuneCase Study of Hotel Taj Vivanta, Pune
Case Study of Hotel Taj Vivanta, PuneLukeKholes
 
VVIP CALL GIRLS Lucknow 💓 Lucknow < Renuka Sharma > 7877925207 Escorts Service
VVIP CALL GIRLS Lucknow 💓 Lucknow < Renuka Sharma > 7877925207 Escorts ServiceVVIP CALL GIRLS Lucknow 💓 Lucknow < Renuka Sharma > 7877925207 Escorts Service
VVIP CALL GIRLS Lucknow 💓 Lucknow < Renuka Sharma > 7877925207 Escorts Servicearoranaina404
 
Booking open Available Pune Call Girls Kirkatwadi 6297143586 Call Hot Indian...
Booking open Available Pune Call Girls Kirkatwadi  6297143586 Call Hot Indian...Booking open Available Pune Call Girls Kirkatwadi  6297143586 Call Hot Indian...
Booking open Available Pune Call Girls Kirkatwadi 6297143586 Call Hot Indian...Call Girls in Nagpur High Profile
 
call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...Delhi Call girls
 
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...Call Girls in Nagpur High Profile
 
Top Rated Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Call Girls in Nagpur High Profile
 
DragonBall PowerPoint Template for demo.pptx
DragonBall PowerPoint Template for demo.pptxDragonBall PowerPoint Template for demo.pptx
DragonBall PowerPoint Template for demo.pptxmirandajeremy200221
 
Pastel Portfolio _ by Slidesgo.pptx. Xxx
Pastel Portfolio _ by Slidesgo.pptx. XxxPastel Portfolio _ by Slidesgo.pptx. Xxx
Pastel Portfolio _ by Slidesgo.pptx. XxxSegundoManuelFaichin1
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...
VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...
VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...SUHANI PANDEY
 
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...amitlee9823
 
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Hy...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Hy...Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Hy...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Hy...Pooja Nehwal
 
Peaches App development presentation deck
Peaches App development presentation deckPeaches App development presentation deck
Peaches App development presentation decktbatkhuu1
 
Design Inspiration for College by Slidesgo.pptx
Design Inspiration for College by Slidesgo.pptxDesign Inspiration for College by Slidesgo.pptx
Design Inspiration for College by Slidesgo.pptxTusharBahuguna2
 
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...Delhi Call girls
 
Tapestry Clothing Brands: Collapsing the Funnel
Tapestry Clothing Brands: Collapsing the FunnelTapestry Clothing Brands: Collapsing the Funnel
Tapestry Clothing Brands: Collapsing the Funneljen_giacalone
 

Recently uploaded (20)

Editorial design Magazine design project.pdf
Editorial design Magazine design project.pdfEditorial design Magazine design project.pdf
Editorial design Magazine design project.pdf
 
young call girls in Vivek Vihar🔝 9953056974 🔝 Delhi escort Service
young call girls in Vivek Vihar🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Vivek Vihar🔝 9953056974 🔝 Delhi escort Service
young call girls in Vivek Vihar🔝 9953056974 🔝 Delhi escort Service
 
Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
 
Case Study of Hotel Taj Vivanta, Pune
Case Study of Hotel Taj Vivanta, PuneCase Study of Hotel Taj Vivanta, Pune
Case Study of Hotel Taj Vivanta, Pune
 
VVIP CALL GIRLS Lucknow 💓 Lucknow < Renuka Sharma > 7877925207 Escorts Service
VVIP CALL GIRLS Lucknow 💓 Lucknow < Renuka Sharma > 7877925207 Escorts ServiceVVIP CALL GIRLS Lucknow 💓 Lucknow < Renuka Sharma > 7877925207 Escorts Service
VVIP CALL GIRLS Lucknow 💓 Lucknow < Renuka Sharma > 7877925207 Escorts Service
 
Booking open Available Pune Call Girls Kirkatwadi 6297143586 Call Hot Indian...
Booking open Available Pune Call Girls Kirkatwadi  6297143586 Call Hot Indian...Booking open Available Pune Call Girls Kirkatwadi  6297143586 Call Hot Indian...
Booking open Available Pune Call Girls Kirkatwadi 6297143586 Call Hot Indian...
 
call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
 
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
 
Top Rated Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
 
DragonBall PowerPoint Template for demo.pptx
DragonBall PowerPoint Template for demo.pptxDragonBall PowerPoint Template for demo.pptx
DragonBall PowerPoint Template for demo.pptx
 
Pastel Portfolio _ by Slidesgo.pptx. Xxx
Pastel Portfolio _ by Slidesgo.pptx. XxxPastel Portfolio _ by Slidesgo.pptx. Xxx
Pastel Portfolio _ by Slidesgo.pptx. Xxx
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
Call Girls Service Mukherjee Nagar @9999965857 Delhi 🫦 No Advance VVIP 🍎 SER...
Call Girls Service Mukherjee Nagar @9999965857 Delhi 🫦 No Advance  VVIP 🍎 SER...Call Girls Service Mukherjee Nagar @9999965857 Delhi 🫦 No Advance  VVIP 🍎 SER...
Call Girls Service Mukherjee Nagar @9999965857 Delhi 🫦 No Advance VVIP 🍎 SER...
 
VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...
VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...
VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...
 
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Hy...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Hy...Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Hy...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Hy...
 
Peaches App development presentation deck
Peaches App development presentation deckPeaches App development presentation deck
Peaches App development presentation deck
 
Design Inspiration for College by Slidesgo.pptx
Design Inspiration for College by Slidesgo.pptxDesign Inspiration for College by Slidesgo.pptx
Design Inspiration for College by Slidesgo.pptx
 
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
 
Tapestry Clothing Brands: Collapsing the Funnel
Tapestry Clothing Brands: Collapsing the FunnelTapestry Clothing Brands: Collapsing the Funnel
Tapestry Clothing Brands: Collapsing the Funnel
 

CSS3 cores e transparencia

  • 2. Before we talk about CSS3 colors, we need to review CSS2.1 colors.
  • 4. CSS2.1 allowed colors to be defined using six different types of values.
  • 5. 1 Keywords 2 Six-digit hexadecimal notation 3 Three-digit hexadecimal notation 4 RGB numeric notation 5 RGB percentage notation 6 System colors
  • 7. CSS2.1 allowed 17 keywords: aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, orange, purple, red, silver, teal, white, and yellow.
  • 8. Example keywords: p { color: aqua; } p { color: black; } p { color: blue; } p { color: fuchsia; } p { color: gray; } p { color: green; } p { color: lime; }
  • 10. Six-digit hexadecimal notation (#rrggbb): p { color: #AE03FF; }
  • 12. Three-digit hexadecimal notation allows authors to replace double ‘rr’, ‘gg’ or ‘bb’ values with single values (#rgb): p { color: #663399; } p { color: #639; } p { color: #aaff55; } p { color: #af5; }
  • 13. The six-digit RGB notation (#rrggbb) can only by converted into three-digit form (#rgb) if each the rr, gg, and bb values each use duplicate digits. Many six- digit values cannot be converted. Cannot convert p { color: #953d3d; } p { color: #34d209; } Cannot convert
  • 14. 4. RGB numeric notation
  • 15. RGB numeric notation uses 'rgb(' followed by a comma- separated list of three integer values, followed by ‘)’. p { color: rgb(109, 22, 255); }
  • 16. RGB numeric notation allows values between 0 (black) and 255 (white). No unit identifier is required.
  • 17. 5. RGB percentage notation
  • 18. RGB percentage notation uses 'rgb(' followed by a comma- separated list of three percentage values, followed by ')'. p { color: rgb(0%,10%,100%); }
  • 19. RGB percentage notation allows values between 0% (black) and 100% (white). All values must include % symbol.
  • 21. CSS2.1 allowed System colors to be used to specify colors that matched the operating system's graphic style. p { color: ButtonFace; }
  • 22. Note: System Colors have been deprecated in favor of the CSS3 UI “appearance’ property for specifying the complete look of user interface related elements.
  • 24. With CSS3, we can now apply colours using eight new methods:
  • 25. 1 Extended color keywords 2 Opacity 3 RGBA numeric notation 4 RGBA percentage notation 5 HSL notation 6 HSLA notation 7 The ‘currentColor’ keyword 8 The ‘transparent’ keyword
  • 26. 1. Extended Color Keywords
  • 27. While CSS2.1 allowed us to use 17 basic color keywords, CSS3 allows us to use and additional 130 extended color keywords. This is a total of 147 keywords.
  • 28. Example color keywords: p { color: peru; } p { color: salmon; } p { color: thisle; } p { color: firebrick; } p { color: ghostwhite; } p { color: goldenrod; } p { color: honeydew; }
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40. Quick tip: Do you have trouble spelling the keyword gray/grey? Well, CSS3 color keywords have got you covered. They include gray, grey, darkgrey and darkgray.
  • 41. Browser Supported Firefox 3.6, 4 Yes Safari 4, 5 Yes Chrome 9, 10 Yes Opera 10, 11 Yes IE 6, 7, 8, 9 Yes
  • 43. Opacity allows us to dictate the opacity/transparency of elements.
  • 44. Opacity values range from 0 (or 0.0), which is fully transparent to 1 (or 1.0) which is 100% opaque. p { opacity: 0.3; }
  • 45. The opacity value must be a number, which is zero or more digits followed by a dot (.) followed by one or more digits. For example: 0.5 .5
  • 46. Be aware that this property will set the opacity for the element and all of it’s child elements.
  • 47. Browser Supported Firefox 3.6, 4 Yes Safari 4, 5 Yes Chrome 9, 10 Yes Opera 10, 11 Yes IE 6, 7, 8 No IE 9 Yes
  • 48. 3. RGBA numeric notation
  • 49. With CSS3 we can add an alpha channel to RGB values. This allows us to set our colors to specific levels of opacity.
  • 50. While the ‘opacity’ property sets the opacity/transparency of entire elements, RGBA is used to set the opacity of color values only.
  • 51. RGBA numeric notation uses 'rgba(' followed by a comma-separated list of three integer values, followed by an alpha value followed by a ‘)’. p { color: rgba(100, 66, 255, 1); }
  • 52. The three integer values must be between 0 (black) and 255 (white). No unit identifier is required. For example: 255 0
  • 53. This alpha value must be a number, which is zero or more digits followed by a dot (.) followed by one or more digits. For example: 0.5 .5
  • 54. An alpha value of 1 means the color will be fully opaque (displayed as a solid color). An alpha value of 0.5 will be half opaque.
  • 55. You should always include a backup for browsers that do not support this property. p { color: rgb(100, 66, 255); color: rgba(100, 66, 255, 0.5); }
  • 56. Browser Supported Firefox 3.6, 4 Yes Safari 4, 5 Yes Chrome 9, 10 Yes Opera 10, 11 Yes IE 6, 7, 8 No IE 9 Yes
  • 57. 4. RGBA percentage notation
  • 58. RGBA percentage notation uses 'rgba(' followed by a comma-separated list of three percentage values, followed by an alpha value followed by a ‘)’. p { color: rgba(10%, 6%, 20%, 1); }
  • 59. The three percentage values must be between 0% (black) and 100% (white). All values must include % symbol. For example: 100% 0%
  • 60. This alpha value must be a number, which is zero or more digits followed by a dot (.) followed by one or more digits. For example: 0.5 .5
  • 61. Browser Supported Firefox 3.6, 4 Yes Safari 4, 5 Yes Chrome 9, 10 Yes Opera 10, 11 Yes IE 6, 7, 8 No IE 9 Yes
  • 63. HSL notation allows us to define colors using hue, saturation and lightness.
  • 64. HSL notation is written like this: p { color: hsl(280,100%,50%); }
  • 65. The first value is for Hue and must be a integer value between 0 and 359. p { color: hsl(280,100%,50%); }
  • 66. The second value is for Saturation and must be defined as a percentage value. p { color: hsl(280,100%,50%); }
  • 67. The third value is Lightness and must also be defined as a percentage value. p { color: hsl(280,100%,50%); }
  • 68. These three HSL values must be separated by commas. Whitespace after the commas is optional. p { color: hsl(280,100%,50%); }
  • 69. You should always include a backup color that is not HSL for older browsers. p { color: rgb(85,0,128); color: hsl(280,100%,50%); }
  • 70. Browser Supported Firefox 3.6, 4 Yes Safari 4, 5 Yes Chrome 9, 10 Yes Opera 10, 11 Yes IE 6, 7, 8 No IE 9 Yes
  • 72. Like RGBA, we can add an alpha channel to HSL values. This allows us to set our colors to specific levels of opacity.
  • 73. First of all, we need to change the HSL to HSLA: p { color: hsla(280,100%,50%); }
  • 74. Then, we need to add a new value at the end of the three comma-separated values. p { color: hsla(280,100%,50%,0.5); }
  • 75. The opacity value must be a number, which is zero or more digits followed by a dot (.) followed by one or more digits. For example: 0.5 .5
  • 76. You should always include a backup color that is not HSL or HSLA for older browsers. p { color: rgb(85,0,128); color: hsla(280,100%,50%,0.5); }
  • 77. Browser Supported Firefox 3.6, 4 Yes Safari 4, 5 Yes Chrome 9, 10 Yes Opera 10, 11 Yes IE 6, 7, 8 No IE 9 Yes
  • 78. Why use HSL or HSLA?
  • 79. From the browsers point of view, there is no difference between values defined in RGBA or HSLA.
  • 80. Some designers find it easier to choose and adjust colors using HSLA.
  • 82. CSS1 and CSS2 defined the initial value of the ‘border- color’ property to be “the value of the ‘color’ property” . However, there is no corresponding keyword.
  • 83. We had no way of specifying a border-color to match the color. p { color: red; border-width: 1px; border-style: solid; border-color: “the value of the ‘color’ property”; }
  • 84. CSS3 allows us to the currentColor keyword for this: p { color: red; border-width: 1px; border-style: solid; border-color: currentColor; }
  • 85. Browser Supported Firefox 3.6, 4 Yes Safari 4, 5 Yes Chrome 8, 9, 10 Yes Opera 11 Yes IE 6, 7, 8 No IE 9 Yes
  • 87. CSS1 introduced the ‘transparent’ value for the background-color property.
  • 88. CSS2 allowed the ‘transparent’ value to be applied to the ‘border- color’ property.
  • 89. CSS3 allows the ‘transparent’ keyword to be applied to any properties that accepts a ‘color’ value. p { color: transparent; }
  • 90. Browser Supported Firefox 3.6, 4 Yes Safari 4, 5 Yes Chrome 9, 10 Yes Opera 10, 11 Yes IE 6, 7, 8 No IE 9 Yes
  • 91. Russ Weakley Max Design Site: maxdesign.com.au Twitter: twitter.com/russmaxdesign Slideshare: slideshare.net/maxdesign Linkedin: linkedin.com/in/russweakley