• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Css3 color
 

Css3 color

on

  • 783 views

Different models of definiting color in cascading style sheets.

Different models of definiting color in cascading style sheets.

Statistics

Views

Total Views
783
Views on SlideShare
783
Embed Views
0

Actions

Likes
0
Downloads
5
Comments
1

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as OpenOffice

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

11 of 1 previous next

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • nice preso!
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Css3 color Css3 color Presentation Transcript

    • CSS3 color
    • Work with color http://www.w3.org/TR/css3-color
    • Determining color in CSS color: #000 background-color:#333 border-color:#999
    • Color Keywords
    • Color Keywords
    • Color Keywords
    • Color Keywords
    • Determining color in CSS3
      • Hexadecimal expressions and keywords
      • CSS 2.1 allows to determine color as RGB values
      • CSS3 adds keywords SVG 1.0 to the specification
      • More information on available keywords:
      • http://www.w3.org/TR/css3-color/#svg-color
    • New color models in CSS3
      • RGB (in CSS2)
      • red, green, blue
      • RGBA (in CSS3)
      • red, green, blue, alpha transparency
      • HSL
      • hue, saturation, lightness
      • HSLA
      • hue, saturation, lightness, alpha
      • CMYK (in Generated Paged Media Module)
      • cyan, magenta, yellow, black
    • RGB is a mixed color model. Red, green and blue are mixed together in order to form other colors. As a mixed model, 100% of all the three colors will give white color.
    • Syntax RGB rgb(0,0,0) rgb(255,255,255) rgb(69%,9%,12%) In CSS RGB values can be written as the three different values separated by a comma ranging from 0 to 255, or as a percentage ranging from 0 to 100%, in the following order: red, green and blue.
    • RGBA Model A new color model introduced in CSS3. It allows to add alfa value which specifies a level of opacity. It is supported in Safari 3.2+, Chrome 3+, Firefox 3+, Opera 10+, IE9 Beta. .nav { color: rgba(0, 0, 0, 60% ); /* black at 60% opacity */ } .nav { color: rgba(0, 0, 0, 0.6 ); /* black at 60% opacity */ }
    • RGBA Model Value 1 ( 100% ) means that the color is opaque . Value 0 means that the color is fully transparent .
    • Styling the link color with RGBA RGBA model can help us style the link color. It allows to make the text soak up some of the background color behind it. The white color at 70% opacity allows the background to shine through. .nav li a { color: rgba(255, 255, 255, 0.7); }
    • RGBA backup Due to the fact that RGBA is not supported by all browsers it is a good practice to provide sort of backup for the browers which don't support this color model. In the code we should put a solid color first. The browers which support RBGA will override the solid color whereas the browsers which don't support RGBA will ignore RGBA rule. .nav li a { color: #ccc; color: rgba(255, 255, 255, 0.7); }
    • Important ! Remember to specify solid backups for RGBA colors in a separate rule which appears BEFORE the RGBA rule.
    • Hue Saturation Lightness
        HUE
    • Hue Saturation Lightness
        LIGHTNESS
    • Hue Saturation Lightness
        SATURATION
    • Hue Saturation Lightness
    • SYNTAX HSL
        hsl(0,10%,95%)
    • Adding alpha value
    • Current support color syntax rgbs ( ) 4 3 x* 10 4 hsl ( ) 4 3 x* 10 4 hsla ( ) 4 3 x* 10 4 *support added for IE 9
    • Current support
    • Thank you for your attention. Visit my website: www.slawomirzdunek.com Follow me on Twitter: http://twitter.com/#!/slawomirzdunek Find me on Facebook.